Return to Snippet

Revision: 48909
at July 12, 2011 21:24 by yanek1988


Initial Code
// file.ini
[smtp]
serwer=yanek.code-laboratory.com
[email protected]
password=pass

// controller
$smtp = new Zend_Config_Ini ('/application/config/file.ini', 'smtp');
$config = array('auth'=>'login', 'username'=>$smtp->username, 'password'=>$smtp->password);
$transport = new Zend_Mail_Transport_Smtp($smtp->serwer, $config);
Zend_Mail::setDefaultReplyTo('[email protected]');

foreach ($mails as $mail){
	try {
	$zm = new Zend_Mail('utf-8');
	$zm->setBodyHtml( 'hello world' );
	$zm->setFrom( $smtp->username, 'yanek' );
	$zm->addTo( $mail );
	$zm->setSubject( 'Subject' );
	$zm->send($transport);
        } catch (Exception $e){}
}

Initial URL


Initial Description


Initial Title
Zend Mail - SMPT

Initial Tags


Initial Language
PHP