Thread: HTML-emails

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Sweden
    Posts
    384
    Rep Power
    15
    Hello All,

    Does anybody know how to send an email in html-format? (content-type:text/html)

    Regards,
    Chrille :-D
    Sweden
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Sweden
    Posts
    384
    Rep Power
    15
    I found the solution myself:

    Author: eduardo ()
    Date: Sun Oct 03 11:23:39 1999 CDT

    You have to specify the correct headers, that's all. In particular, the MIME and content-type ones. Form example:


    $headers = "From: me@here.comn";
    $headers .= "Reply-To: me@here.comn";
    $headers .= "Organization: heren";
    $headers .= "MIME-Version: 1.0n";
    $headers .= "Content-Type: text/html; charset=iso-8859-1n";
    $headers .= "Content-Transfer-Encoding: 8bitn";

    $body = "<HTML>n";
    $body .= "<BODY>n";
    $body .= "<I>Hello</I>n";
    $body .= "</BODY>n";
    $body .= "</HTML>n";

    mail("you@there.com", "Hello", $body, $headers);


    Thanks, eduardo!!!

    /Chrille
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Hillsboro, OR, USA
    Posts
    12
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Chrille:
    I found the solution myself:

    Author: eduardo ()
    Date: Sun Oct 03 11:23:39 1999 CDT

    You have to specify the correct headers, that's all. In particular, the MIME and content-type ones. Form example:


    $headers = "From: me@here.comn";
    $headers .= "Reply-To: me@here.comn";
    $headers .= "Organization: heren";
    $headers .= "MIME-Version: 1.0n";
    $headers .= "Content-Type: text/html; charset=iso-8859-1n";
    $headers .= "Content-Transfer-Encoding: 8bitn";

    $body = "<HTML>n";
    $body .= "<BODY>n";
    $body .= "<I>Hello</I>n";
    $body .= "</BODY>n";
    $body .= "</HTML>n";

    mail("you@there.com", "Hello", $body, $headers);


    Thanks, eduardo!!!

    /Chrille
    [/quote]

    Hello I read your message since I was having the same problem and it helped. The only problem is when I try certian commands they dont work and I get a php error on the following line.
    here is what I typed:
    $body .= "<p><fontcolor="#FF3333">tim</font></p>";

    Thanks

    Tim

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Sweden
    Posts
    384
    Rep Power
    15
    Hi.

    You need to remove or " all ".
    Like:

    $body .= "<p><fontcolor="#FF3333">tim</font></p>";

    Best regards,
    Christoffer
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    32
    Rep Power
    15
    Yeah, use the addslashes function.. it helps when you have lots of slashes to add..

    addslashes()

    scoobydoo

Similar Threads

  1. How to get client email??Help plz
    By Gecko22 in forum ASP Programming
    Replies: 12
    Last Post: January 22nd, 2004, 02:40 PM
  2. not returning records when it should
    By aliaga61 in forum ASP Programming
    Replies: 3
    Last Post: January 16th, 2004, 11:57 AM
  3. 'Object required' error
    By aliaga61 in forum ASP Programming
    Replies: 1
    Last Post: January 16th, 2004, 09:48 AM
  4. HTML Emails
    By pkrasnoo in forum HTML Programming
    Replies: 0
    Last Post: December 8th, 2003, 10:33 AM
  5. w3c strict errors (10), css, and js questions
    By WorldBuilder in forum CSS Help
    Replies: 12
    Last Post: November 6th, 2003, 05:48 AM

IMN logo majestic logo threadwatch logo seochat tools logo