SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was wondering if anyone knew how to send html in an e-mail. i tried but the html tags showed up in the e-mail received. Than I tried some classes in my book with MIME but that didnt work either. Hope you guys can help.

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    My book, Beginning PHP4, says to include a MIME header:

    Content-type: text/html

    which requires that it be preceded by:

    MIME-Version: 1.0\r\n

    so, try something like this:

    $mail_headers = "MIME-Version: 1.0\r\n";
    $mail_headers .= "Content-type: text/html";

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where do i put that into? the body of the message?

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the mail function in php takes three parameters plus an optional 4th which is reserved for mail headers including From address and mime types.

    mail("to", "subject", "body", "headers");


    so put it in with the other headers
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright thanks 7sdtud and freddy it worked

  6. #6
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright it wokred for my pop3 account with @home but when I checked on hotmail it gave me a blank message. I was wondering if there was a way to resolve?

  7. #7
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Tutorial for sending HTML email with PHP:
    http://www.phpbuilder.org/columns/kartic20000807.php3
    Last edited by M. Johansson; Apr 21, 2001 at 08:27.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  8. #8
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks truelight and cokeman. that one at zend seems much shorter and I might try that but my servers HD is so screwed up and my hosting company is trying its best to get it back up so i cant even test it out and this sucks.


Bookmarks

Posting Permissions

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