email body showing up Blank in Hotmail?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ninethousandfeet
Forum Contributor
Posts: 130
Joined: Tue Mar 10, 2009 4:56 pm

email body showing up Blank in Hotmail?

Post 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);
 
Last edited by Benjamin on Tue Apr 28, 2009 5:41 pm, edited 1 time in total.
Reason: Changed code type from text to php.
lettie_dude
Forum Commoner
Posts: 65
Joined: Thu Dec 07, 2006 10:10 am

Re: email body showing up Blank in Hotmail?

Post 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" />
Last edited by Benjamin on Wed Apr 29, 2009 4:27 am, edited 1 time in total.
Reason: Added code tags.
Post Reply