我正在使用 cakephp 2.2
这是我在 Config/email.php 中的 smtp 设置
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => 'appmailer@someapp.com',
'password' => 'somepassword',
'transport' => 'Smtp'
);
这是我的电子邮件设置。
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail('gmail');
$email->from(array('bigshot@company.com' => 'On Behalf of Big Shot'));
$email->to('client@bigshotclient.com');
$email->subject('[Test -- please ignore] one last test. Remember to hit REPLY to this email');
$email->sender('appmailer@someapp.com');
$email->replyTo('bigshot@company.com', 'Big Shot');
$email->send('Remember to hit REPLY to this email');
发送邮件时,FROM地址反复显示
On Behalf of Big Shot<appmailer@someapp.com>
如何使 FROM 显示为 bigshot@company.com 的原始电子邮件地址?
顺便说一句,replyTo 效果很好。
我正在尝试完善邮件传递。