Page 1 of 1

email body showing up Blank in Hotmail?

Posted: Tue Apr 28, 2009 5:12 pm
by ninethousandfeet
hello,

when a new user registers on my site, they are sent an email. the email body is not showing up in hotmail and msn mail accounts. i've been reading about all of these different hotmail issues and it sounds like it's something to do with my headers, but i can't figure it out... any ideas would be more than helpful. thank you.

Code: Select all

 
$to = $_POST['email']; // user email
    $subject = 'You are now registered with mysite.com';
    $message = "
<head>
<title>mysite</title>
</head>
 
<body>
<table align='center' bordercolor='#330066' border='0' width='400'cellspacing='5' cellpadding='5'>
... the message of my email is placed here... one image, but mostly all text inside of this table. 
</table>
</body>
</html>
";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'Content-type: image/jpg;' . "\r\n";
$headers .= 'From: me <me@mysite.com>' . "\r\n";
$mailSent = mail($to, $subject, $message, $headers);
 

Re: email body showing up Blank in Hotmail?

Posted: Wed Apr 29, 2009 3:20 am
by lettie_dude
Try this.

Code: Select all

 
$from = 'From: me <me@mysite.com>';
$header = "MIME-Version:1.0\r\nContent-type:text/html;Charset=iso-8859-1\r\n".$from
mail($to,$subject,$message,$headers);
 
With the image. Upload it to a folder on the your server and reference it directly from the email. i.e. <img src="http://www.yoursite.com/yourfolder/yourimage.jpg" />