0
<?php
ini_set("sendmail_from", "emailer@benjaminpotter.org");

    $to = 'haneef.fathani@gmail.com';
    $subject = " Newsletter Form Submission";   

    $emailthing = '    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Submission - Newsletter Update</title>
</head>
<style type="text/css">
body {
    background-color:#e8faff;   
}

p {
    font-size:15px;
    font-family:Georgia, "Times New Roman", Times, serif;
    color:#141414;
    font-style:italic;
}

#mainbox{
    background-image:url(http://www.benjaminpotter.org/Images/emailtotheuser.jpg);
    width:345px;
    height:404px;   
    margin-left:auto;
    margin-right:auto;
    display:block;
    margin-top:50px;
}

#mainbox #textholder{
    width:279px;
    height:300px;
    display:block;
    position:absolute;
    margin-top:80px;
    margin-left:30px;   
}

#special{
    color:#72C0EF;
    text-align:center !important;
    font-style:normal;
}
</style>



<body bgcolor="#72c0ef">
<div style="background-image:url(http://www.benjaminpotter.org/Images/emailtotheuser.jpg); width:345px; height:404px; margin-left:auto; margin-right:auto; display:block; margin-top:50px;">
<div style="width:279px; height:300px; display:block; position:absolute; margin-top:80px; margin-left:30px;">
<p style="font-size:15px; font-family:Georgia, \'Times New Roman\', Times, serif; color:#141414; font-style:italic;">
Thanks for signing up!<br />
I currently have you under the email:<br />


<br />
You will be receiving tri-monthly / <br />
quarterly emails from me, updating you<br />
on my latest works.<br />
<br />
Thank you for your intrest in <strong>
Web Design</strong>, you will receive the first newsletter soon.<br />
<br />
<br />
Yours Sincerely,
<br />
<strong>Ben Potter</strong>
</p>
</div>
</div>
</body>
</html>';

$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";

mail($to, $subject, $emailthing, $headers); 

?>

我正在尝试发送一封精美的 html 格式的电子邮件,这是我的代码,但我仍然无法发送正确的邮件设计,实际上我收到一封包含所有代码的普通电子邮件,任何人都可以帮助我!

4

0 回答 0