Simple code snipplet to send an email using zend framework is as follows:
$config = Zend_Registry::get('config');//gets the config file i.e from application.ini $configParam = array('auth' => $config['mail']['authtype'], 'username' => $config['mail']['username'], 'password' => $config['mail']['password'], 'ssl' => 'tls', 'port' => 587 );//sets all the configuration parameters //for gmail you need to set 'ssl' => 'tls' otherwise its not required and mention the port for that specific mail server. For gmail port is 587 $zendTransport = new Zend_Mail_Transport_Smtp($smtpServer, $configParam); $mail = new Zend_Mail(); $mail->setBodyHtml($emailBody) ->setFrom($fromEmailAddress, $fromEmailName) ->addTo($emailAddresses) ->addBcc($bccEmailAddresses); ->setSubject($subject) ->send($zendTransport);
0 Comments.