How to send news letters in zend
Posted
by Sherif
on Stack Overflow
See other posts from Stack Overflow
or by Sherif
Published on 2010-04-21T17:08:50Z
Indexed on
2010/04/21
17:13 UTC
Read the original article
Hit count: 268
php
|zend-framework
i am trying to send something like news letter Via Zend_Mail but after 12 mail i got this message
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Zend\Apache2\htdocs\forga\library\Zend\Mail\Protocol\Abstract.php on line 321
my Code is like:
$smtpHost = 'smtp.gmail.com';
$smtpConf = array(
'auth' => 'login',
'ssl' => 'tls',
'port' => '587',
'username' =>'[email protected]',
'password' => 'xxxxxxxx'
);
$transport = new Zend_Mail_Transport_Smtp($smtpHost, $smtpConf);
foreach($users as $user)
{
$mail = new Zend_Mail();
$mail->setFrom("[email protected]", 'Forga');
$mail->setSubject($subject);
if($html=='on')
$mail->setBodyHtml($message);
else
$mail->setBodyText($message);
$mail->addto($user);
$transport->send($mail);
}
© Stack Overflow or respective owner