A simple way to initiate Zend_Mail configuration automatically
Filed under Zend Framework
You simply extend the Zend_Mail class and:
Class My_Mail extends Zend_Mail { public $_transport = null; public function setup() { $config = array('auth' => 'login', 'username' => 'yourmail@here.com', 'password' => 'password', 'ssl' => 'tls', 'port' => 25); $transport = new Zend_Mail_Transport_Smtp('your.provider.smtp', $config); Zend_Mail::setDefaultTransport($transport); } }
Then:
$mail = new My_Mail(); $mail->setup();
Sep13