当我使用setReturnPath设置返回路径时,生成的电子邮件的电子邮件标题与SET值(info@test.com)不同。这是Zend Framework 1.12.3的问题吗? 或者我可以用另一个设置/标题修复它吗?
$mail = new Zend_Mail();
$mail->setBodyHtml($html);
$mail->setReplyTo('info@test.com');
$mail->setReturnPath('noreply@test.com');
$mail->setFrom('info@test.com', '...');
$mail->addTo(...);
$mail->setSubject(...);
$mail->send();
答案 0 :(得分:0)
您是否考虑过代码的顺序? 此代码未经测试我或我的工作。
//Create Zend_Mail object.
$MailObj = new Zend_Mail();
$message= "<h1>Welcome to the example</h1><br>" .
"<p>An example email.</p>";
//Initialize parameters.
$fromEmail = "FROM_EMAIL_ADDRESS";
$fromFullName = "FROM_FULL_NAME";
$to = "YOUR_EMAIL_HERE";
$subject = "This is an example";
$MailObj->setBodyHtml($message);
$MailObj->setFrom($fromEmail, $fromFullName);
$MailObj->addTo($to);
$MailObj->setSubject($subject);
$MailObj->setReplyTo('info@test.com');
$MailObj->setReturnPath('noreply@test.com');