In this article I am going to discuss how to send email with SMTP authentication. Please do tell me whether it helped you or not.

You can send email using zend famework as follows:

$emial_body = “<table><tr><td>Body of the email</td></tr></table”;

$mail = new Zend_Mail();
$mail->setBodyHtml($email_body);
$mail->setFrom('support@domain.com', 'Example');
$mail->addTo('user@abc.xyz', 'Username');
$mail->setSubject('Sending email using Zend Framework');
$mail->send();

If you require SMTP authentication while sending email in zend framework, use following code: This way of sending email will help the mail going in spam.

$emial_body = “<table><tr><td>Body of the email</td></tr></table”;
$config = array('auth' => 'login','username' => "info@domainname.com",
'password' => 'password');
$transport = new Zend_Mail_Transport_Smtp('mail.domainname.com', $config);
$mail = new Zend_Mail(); $mail->setBodyHtml($email_body); $mail->setFrom('support@domain.com', 'Example'); $mail->addTo('user@abc.xyz', 'Username'); $mail->setSubject('Sending email using Zend Framework'); $mail->send(
$transport);