Page 1 of 1

mail doesnt render content

Posted: Tue May 15, 2007 7:49 am
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);

Posted: Tue May 15, 2007 8:38 am
by feyd
Why not make this so much simpler by using Swift?

Posted: Tue May 15, 2007 8:58 am
by dude81
Sure Feyd, I'll defnitely look into it. But any how , the above problem is fixed , content-type in headers was wrong.