에서 HTML 전자 메일 보내기 사용자의 전자 메일 주소를 수집하여 데이터베이스에 제출하는 과정에 있습니다. 그러나 실제로 수행하고 싶은 작업은 HTML 전자 메일을 제출하는 것입니다.PHP 문서
내가 이메일의 HTML을 만들었습니다 (인라인 CSS로, 그것은 1 페이지 문자 그대로)과는 다음과 같습니다
그럼이 코드를 가져다가 PHP에서 이메일 submittingness을 썼다 :
ini_set("sendmail_from", "[email protected]");
$to = $email;
$subject = "Ben Potter Web Design - 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>
<div id="mainbox">
<div id="textholder">
<p>
Thanks for signing up!<br />
I currently have you under the email:<br />
<span id="special">' . $email . '</span>
<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>Ben Potter
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>';
$Rconfucious = "MIME-Version: 1.0\r\n";
$Rconfucious .= "Content-type: text/html; charset=iso-8859-1\r\n";
$Rconfucious .= 'From: Ben Potter Web Design 2011 <[email protected]>' . "\r\n";
@mail($to, $subject, $emailthing, $Rconfucious);
그러나 문제는이 같은 통해 제공한다는 것입니다 :
그러면 어떻게 제대로 작동합니까? 또한 사이드 노트 - 이메일은 항상 정크 메일로 곧바로 이동하며 이것을 변경하는 방법을 모르겠습니다 ... 사용자가 이메일을 볼 수 없게됩니다.
도움 주셔서 감사합니다.
-1 :이 위의 상황과는 아무 상관이 없습니다. 전자 메일이 HTML로 올바르게 전송됩니다. 문제는 Gmail이 '