私は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コードとしてプレーンテキストで送信します。これを受け、私のOutlook 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...
で始まるという点で手掛かりがあると推測しています最初のスペース!