Skip to content

Instantly share code, notes, and snippets.

@Narven
Created November 27, 2013 14:44
Show Gist options
  • Select an option

  • Save Narven/7676811 to your computer and use it in GitHub Desktop.

Select an option

Save Narven/7676811 to your computer and use it in GitHub Desktop.
Send emails in Yii with Zend Mail (local e production)
$smtpConfig = array(
'ssl' => 'ssl',
'port' => '465',
'auth' => 'login',
'username' => '[email protected]',
'password' => 'password'
);
// default
//$oTransport = new Zend_Mail_Transport_Smtp(); // @TODO enable for production
// localhost
$oTransport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $smtpConfig ); // @TODO remove for production
Zend_Mail::setDefaultTransport( $oTransport );
$oMail = new Zend_Mail( 'UTF-8' );
$oMail->setFrom( '[email protected]', 'CLIENT' );
$oMail->setBodyHtml( 'HELLO WORLD' );
$oMail->addTo( '[email protected]' );
$oMail->setSubject( 'Hi There' );
$oMail->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment