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

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2

    Php mail ( spits out html tags )


    Hi.

    Some clients are reporting that they see all the html code from my php mail. I modified the headers so it should work but it doesn't.
    Any idea what i can add so everyone see's html.

    One reported html output came from a @live.be account
    Thanks

    PHP Code:
        $subject "Bedankt voor uw inschrijving";
        
    $headers "MIME-Version: 1.0\r\n";
        
    $headers .= "Content-Type: text/html; charset=utf-8 \r\n";
        
    $headers .= "From: jelle@sportcareers.be\r\n";
        
    $headers .= "Reply-To: jelle@sportcareers.be\r\n";
        
    $headers .= "X-Mailer: PHP/".phpversion()."\r\n";
        
       
    $body '
        <html><head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        </head>
        <body> 
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,230
    Rep Power
    593
    They probably have HTML turned off on their mail readers. You cannot control that. The solution is to create a multi part message that has both HTML and plain text or only send plain text. To make life easy on yourself you should use a mailer package like PHPMailer.

    Comments on this post

    • aeternus agrees
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    Originally Posted by gw1500se
    They probably have HTML turned off on their mail readers. You cannot control that. The solution is to create a multi part message that has both HTML and plain text or only send plain text. To make life easy on yourself you should use a mailer package like PHPMailer.
    So it is possible to check if HTML is turned off? and if it is just output plain text version? if yes could you tell me how please! thank you!
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,690
    Rep Power
    6351
    You can send a multipart message consisting of both rich and plain text versions of the message.

    The first google result for the terms is this, but I don't know how accurate it is.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo