전 Amazon AWS SES를 사용하고 있습니다. 다음은 이메일을 보내는 방법입니다.HTML 메일을 HTML 코드로 보내려면
$request = array();
$request['Source'] = $row['emailfromname'] . " <{$verifyemail[0]}>";
$request['Destination']['ToAddresses'] = $to;
$request['Message']['Subject']['Data'] = $row['emailsubject'];
$request['Message']['Body']['Html']['Data'] = $row['emailbody'];
try {
$result = $client->sendEmail($request);
$messageId = $result->get('MessageId');
...
그래서 매우 기본입니다.
내 문제는 일부 이메일이 HTML로 전송된다는 것입니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p><span style="font-family: Calibri, sans-serif; line-height: 11pt; font-size: 11pt; color: #333333;">Hi Name,</span></p>
<hr><span style="font-size:11pt;font-family:'Calibri',sans-serif"><b>From:</b> [email protected]<br><b>Sent:</b> Thursday, 9 March 2017 10:51 AM<br><b>To:</b> [email protected]<br><b>Subject:</b> Enquiry for ID: 98419081886, 123 Fake Street,
Docklands, Vic 3008, Listing Agent Leasing Consultant</span><br><br><div id="message" style="width: 600px; margin: 0 auto;">
<h1 class="header">
<img src="http://www.test.com/logo.png" style="border: 0; width: 258px;"><div class="header-separator" style="height: 4px; background-color: #e4002b; width: 100%; margin-top: 17px;"></div>
</h1>
<p style="margin: 0;">You have received a new enquiry for</p>
<br><p style="margin: 0;"> id: 98419081886</p>
<div class="footer" style="margin-top: 1em; padding: 5px; background: #999999; color: #fff;">
Message sent from <a href="http://www.test.com.au" style="color: #fff;">www.test.com.au</a> </div>
</div></body></html>
그것은 이상한 헤더 정보와 HTML 코드로 일반 텍스트로 전송 다음은 범죄자의 예입니다. 이것은 내 아웃룩 2010 이메일 수신 :
Docklands, Vic 3008, Listing Agent Leasing Consultant
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p><span style="font-family: Calibri, sans-serif; line-height: 11pt; font-size: 11pt; color: #333333;">Hi Name,</span></p> <hr><span style="font-size:11pt;font-family:'Calibri',sans-serif"><b>From:</b> [email protected]<br><b>Sent:</b> Thursday, 9 March 2017 10:51 AM<br><b>To:</b> [email protected]<br><b>Subject:</b> Enquiry for ID: 98419081886, 123 Fake Street, Docklands, Vic 3008, Listing Agent Leasing Consultant</span><br><br><div id="message" style="width: 600px; margin: 0 auto;">
<h1 class="header">
<img src="http://www.test.com/logo.png" style="border: 0; width: 258px;"><div class="header-separator" style="height: 4px; background-color: #e4002b; width: 100%; margin-top: 17px;"></div>
</h1>
<p style="margin: 0;">You have received a new enquiry for</p>
<br><p style="margin: 0;"> id: 98419081886</p>
<div class="footer" style="margin-top: 1em; padding: 5px; background: #999999; color: #fff;">
Message sent from <a href="http://www.test.com.au" style="color: #fff;">www.test.com.au</a> </div>
</div></body></html>
정말 나를 혼동 년대 일을하지만, 다른 매우 유사 이메일 전혀 문제없이 보낼 수 있다는 것입니다!
그에서 단서 출력의 첫 번째 줄은 Docklands, VIC 3008 ...
를 읽어하지만 (그래서 123 Fake StreetDocklands
를 읽고) 그 라인 - 휴식 공간과 쉼표를 제거하는 경우에도, 출력 스틸이 Docklands...
포함로 시작 거기 같은데요 처음에는 공간!