mail doesnt render content

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
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

mail doesnt render content

Post by dude81 »

Hi All,
Whats wrong with below code which doesnot render content in the email client. any help is greatly appreciated.

Code: Select all

$mime_boundary="---Registration--".md5(time());

        $to=$user_email;

        $subject="Site Registration Details";

        $headers= "From: Test Admin<userforums@abcd.com>\r\n";

        $headers .="Reply-To: Test Admin<userforums@abcd.com>\r\n";

        $headers .="MIME-Version: 1.0\r\n";

        $headers .="Content-Type: multipart/alternative;"."boundary=$mime_boundary"."\r\n";

        $message ="";
        $message.="..".$mime_boundary."\r\n";
        $message.="Content-Type: text/html; charset=iso-8859-1"."\r\n";
        $message.="Content-Transfer-Encoding: 8bit"."\r\n";
        $message .="<html><body style=\"font-family:Arial,Verdana,sans-serif; font-size:12px; color:#666666;\"><p>Hello $use
r_name,</p><p>Kindly click on the following link <a href=\"http://localhost/user_thanks.php?user_id=$user_id\">http://localh
ost/$val[0]</a> to complete the registration</p><p>Thank You.</p><p>Admin</p></body></html>\r\n\r\n";

        $mail_send= @mail($to, $subject,$message, $headers);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why not make this so much simpler by using Swift?
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Sure Feyd, I'll defnitely look into it. But any how , the above problem is fixed , content-type in headers was wrong.
Post Reply