Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    outputting emails in html

    I am currently running a mailing list I found off line which is no longer supported. Its simple but the best one Ive ever found, the only thing it lacks is to send message out in HTML format. Is there a funuction I could add to have this happen? what could I do?

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    making an email HTML is basically a case of adding the right headers..

    so

    PHP Code:
    <?
    $headers 
    "MIME-Version: 1.0\n"
    $headers .= "Content-Type: text/html; charset=iso-8859-1\n"
    $headers .= "Content-Transfer-Encoding: 8bit\n"

    $to='someone@blah.com";
    $subject='
    hello in html';
    $msg='
    <html><body><h3>hello</h3></body></html>;

    mail($to,$subject,$msg,$headers);
    ?>
    ... is the simplest example , so its probably a case of finding out where in your script the mail headers are set and adding the appropriate extra ones as above.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the line:

    $to='someone@blah.com";

    should have a single quotation at the end:

    $to='someone@blah.com';

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    DOH

    keep it quiet but I think that Spookster chappie comes in and edits my posts sometimes
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    New Coder
    Join Date
    Oct 2002
    Location
    Ghent, Belgium
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why do I get an error?

    Why do I get this error?
    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING
    in this line:
    PHP Code:
    $headers "MIME-Version: 1.0\n"
    Last edited by LaundroMat; 03-13-2003 at 09:06 AM.
    Those innocent fun games of the hallucination generation

  • #6
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    You do it without the _ lines in?

  • #7
    New Coder
    Join Date
    Oct 2002
    Location
    Ghent, Belgium
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Nightfire
    You do it without the _ lines in?
    Heh. The underscores weren't in the original code; it must've been added by copy-pasting...

    Anyway, I rechecked, never mind the underscores (I'll edit them). Anyone else see what could be the problem?
    Those innocent fun games of the hallucination generation

  • #8
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    there are no errors in that line , check the line immediately preceeding it ?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #9
    New Coder
    Join Date
    Oct 2002
    Location
    Ghent, Belgium
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's no line preceding it... I'll read up on mail() and possible settings and such..Thanks already
    Those innocent fun games of the hallucination generation

  • #10
    New Coder
    Join Date
    Oct 2002
    Location
    Ghent, Belgium
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's no line preceding it... I'll read up on mail() and possible settings and such..Thanks already
    Those innocent fun games of the hallucination generation

  • #11
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oh man now i am confused, if anyone wants to email me I will send them the script and maybe you would see where that function should go. Thanks for the help!

  • #12
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A simple tutorial.
    http://www.phphideout.com/articleview.php/10
    why not post your script?

  • #13
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    good idea, attached is the script!
    Attached Files Attached Files

  • #14
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Well depending on which email(s) it is you're wanting to send in html, find
    PHP Code:
    $headers "From: \"$list_name\" <$owner_email>\r\nReply-To: $owner_email\r\nX-Mailer: PHPMailList V$version [url]http://php.warpedweb.net/\r\n[/url]"
    and change it to
    PHP Code:
    $headers "From: \"$list_name\" <$owner_email>\r\nReply-To: $owner_email\r\nX-Mailer: PHPMailList V$version [url]http://php.warpedweb.net/\r\nMIME-Version:[/url] 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\nContent-Transfer-Encoding: 8bit\r\n"

  • #15
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I could not find that exact statement in the maillist.php, is it possible its called something else?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •