swiftmailerを使用してメールを送信しようとしています。EOD を使用する方法はありますか?
この構文 (彼らのウェブサイトから) は、html で何かを構築するための非常に難しい方法のようです。
'<html>' .
' <head></head>' .
' <body>' .
' Here is an image <img src="' . $cid . '" alt="Image" />' .
' Rest of message' .
' </body>' .
'</html>',
しかし、これを試してみると
$msg = <<<EOD
<html>
<table>
<tr>
<td>
NAME
</td>
<td>
thomas
</td>
</tr>
<tr>
<td>
COMPANY
</td>
<td>
whatever
</td>
</tr>
</table>
<html>
EOD;
// Set the To addresses with an associative array
->setTo(array('whatever@whatever.whatever'=>'thomas'))
// Give it a body
->setBody($msg)
;
// Send the message
$result = $mailer->send($message);
HTMLが印刷されたメールが届くだけです。これを簡単にする方法はありますか?