我正在使用 Zend_Mail 向我的用户发送多封邮件它运作良好,但我对垃圾邮件有一些问题(如 gmail)
我发现了这个但对我不起作用(邮件继续进入垃圾邮件文件夹) Zend_Mail 发送的电子邮件被视为垃圾邮件
也许可能是与 smtp 服务器和我的“setReplyTo”有关的问题?
smtp 服务器:authsmtp.duenove.it setReplyTo:the_email@fasys.it
编码:
require("Zend/Mail.php");
require("Zend/Mail/Transport/Smtp.php");
$config = array('auth' => 'login',
'username' => 'myusername',
'password' => 'mypassword');
$transport = new Zend_Mail_Transport_Smtp('authsmtp.duenove.it', $config);
//test email - for test only
$cliente[0]['mail']="vobislab@libero.it";
$cliente[0]['name']="Andrea Mariani";
$cliente[1]['mail']="noreply.mario@gmail.com";
$cliente[1]['name']="Andrea Gmail";
$mail = new Zend_Mail();
$mail->setReplyTo('info@fasys.it', 'Vobis Valdarno 2.0');
$mail->addHeader('X-Abuse', 'Please report abuse: andream@fasys.it');
$mail->addHeader('List-Unsubscribe', 'http://www.vobisvaldarno.it/newsletter/unsubscribe/');
$mail->addHeader('MIME-Version', '1.0');
$mail->addHeader('Content-Transfer-Encoding', '8bit');
$mail->addHeader('X-Mailer:', 'PHP/'.phpversion());
$mail->setFrom('fasys@vobisvaldarno.it', 'Vobis Valdarno 2.0');
foreach($cliente as $k => $c){
$mail->addTo($c['mail'], $c['name']);
$mail->setSubject('Hello '.$c['name'].', this is a test');
$body=
'<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>test html mail</p>
</body>
<html>';
$mail->setBodyHTML($body);
//send and clear message
$mail->send($transport);
$mail->clearRecipients();
$mail->clearSubject();
}
谢谢大家的建议