Created
November 27, 2013 14:44
-
-
Save Narven/7676811 to your computer and use it in GitHub Desktop.
Send emails in Yii with Zend Mail (local e production)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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