I'm using Zend_Mail for send multiple mails to my users It is work well but i have some problem with spam (like gmail)
I found this but didn't work for me (mail continue to go in spam folder) Zend_Mail sent email is treated as SPAM
maybe could be a problem in relation of smtp server and my "setReplyTo" ?
smtp server: authsmtp.duenove.it setReplyTo : the_email@fasys.it
the code:
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();
}
Thanks you all in advice