你能告诉我,为什么我设置ReturnPath这样使用的Zend_Mail接收到的电子邮件返回路径头使用SMTP服务区域(我在Gmail中查看它们):问题与使用Zend_Mail返回路径
Return-Path: <[email protected]> //I think this is added by server
.....
Return-Path: [email protected] //I think this is cause by returnPath
我设定的回报-path这样的:
$mailer->setReturnPath('[email protected]');
我集运输这样的:
$emailConfig = $this->getOption('email');
$transport = new Zend_Mail_Transport_Smtp($emailConfig['server'], $emailConfig);
Zend_Mail::setDefaultTransport($transport);
如果我不设置ReturnPath这样的服务器添加换货政...路径与我设置的From标题相同。 这是Zend_Mail中的错误还是什么?我的理解是正确的,服务器将添加返回路径头文件与MAIL_FROM中使用的相同,并且setReturnPath不应该人为添加头文件,而只是将其保存为用于MAIL_FROM? 它在Zend_Mail_Transport_Smtp对象改变代码注释行:
/**
* Sets the Return-Path header of the message
*
* @param string $email
* @return Zend_Mail Provides fluent interface
* @throws Zend_Mail_Exception if set multiple times
*/
public function setReturnPath($email)
{
if ($this->_returnPath === null) {
$email = $this->_filterEmail($email);
$this->_returnPath = $email;
//This line presents in Zend_Framework
//I comment this like I get only one return-path the same as
//set using setReturnPath method of Zend_Mail
//$this->_storeHeader('Return-Path', $email, false);
} else {
/**
* @see Zend_Mail_Exception
*/
require_once 'Zend/Mail/Exception.php';
throw new Zend_Mail_Exception('Return-Path Header set twice');
}
return $this;
}
难道你在回答之前写下问题? – Oleg
除了addHeader是不正确的方式来设置标准头,并会失败。 – Oleg
所以我不知道为什么它为我工作 –