zend settings production v testing etc
//to get the email options from application.ini
$bootstrap = $this->getInvokeArg('bootstrap');
$configArray = $bootstrap->getOptions();
$this->config = new Zend_Config($configArray);
settings in application.ini should look like this:
email.outgoingserver = "auth.smtp.1and1.co.uk"
email.username = "noreply@playerreg.co.uk"
email.password = "pass"
call it in your action like this:
//setup email (this should really go elsewhere)
$emailusername = $this->config->email->username;
$emailpassword = $this->config->email->password;
$server = $this->config->email->outgoingserver;
$config = array('auth' => 'login',
'username' => $emailusername,
'password' => $emailpassword);
$transport = new Zend_Mail_Transport_Smtp($server,$config);
Zend_Mail::setDefaultTransport($transport);
