我正在使用cakephp发送邮件,我注意到我的邮件中缺少文字。 经过一些测试后,我意识到“To:”文本以及该行中的所有内容都丢失了。 (也许被视为标题)
以下是我的电子邮件代码:
$this->Email->smtpOptions = array(
'port'=>'25',
'timeout'=>'30',
'host' => 'random.smtp.server',
'username'=>'',
'password'=>''
);
$this->Email->delivery = 'smtp';
$this->Email->to = $originalSender;
$this->Email->replyTo = $emailAddress;
$this->Email->from = $emailAddress;
if (count($recipients) > 0) {
$this->Email->bcc = $recipients;
}
$this->Email->sendAs = 'html';
$this->Email->subject = 'Freedom task';
if (count($allAttachments) > 0) {
$this->Email->attachments = $allAttachments;
}
$body = "Usefull_Separator<br />\n\r".
"Client: Example<br />\n\r".
"Submitted by: Myself<br />\n\r".
"Assigned To: MyMinion<br />\n\r".
"Queue: Bathroom<br />\n\r".
"Date Submitted: Today<br />\n\r".
"Status: Closed<br />\n\r".
"<br />\n\r".
"Kind regards.<br />\n\r".
"Random task simulator";
$this->Email->send($body);
var_dump($body);
那么为什么“要:”从邮件正文中删除?
我正在使用Cakephp 1.3.8
修改 这是var_dump($ body)结果:
string 'Usefull_Separator<br />
Client: Example<br />
Submitted by: Myself<br />
Assigned To: MyMinion<br />
Queue: Bathroom<br />
Date Submitted: Today<br />
Status: Closed<br />
<br />
Kind regards.<br />
Random task simulator' (length=229)
以下是删除“至”部分的电子邮件结果: