これがケーキのコードです.....$email_body
<?php
$this->Email->reset();
$this->Email->delivery = 'smtp';
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'noreply@example.com',
'password'=>'a_password_you_cant_see',
);
$this->Email->sendAs = 'html';
$this->Email->template = 'default';
$this->Email->from = '"NO-REPLY" <noreply@example.com>';
$this->Email->to = "rakib@example.com";
$this->Email->subject = "test PHP html email";
$email_body = "Hello message body
<hr />
This is rakib
<br />
<table width=\"100%\" bgcolor=\"#ff0\">
<tr>
<td>
In a table
</td>
</tr>
</table>";
$this->Email->send($email_body);
?>
Show Original
このメールを送信した後、 [メールの右上隅にある] GMail のドロップダウン メニューからボタンを使用して元のメールの内容を表示すると、HTML は次のようになります。
<!-- Starting to render - email/html/default -->
<p> Hello message body</p>
<p> <hr /></p>
<p> This is rakib</p>
<p> <br /></p>
<p> <table width="100%" bgcolor="#ff0"></p>
<p> <tr></p>
<p> <td></p>
<p> In a table</p>
<p> </td></p>
<p> </tr></p>
<p> </table></p>
<p> </p>
<!-- Finished - email/html/default -->
<p>
タグはすべての新しい行に含まれて</p>
いました.....それはなぜですか? CakePHP 1.3 の使用