/** * Init htmlMimeMail5, EmailConfiguration, EmailNotificationConfiguration. * Set smtp params, sendmailpath, from. **/ public function __construct() { $this->emailNotificationConfig = new EmailNotificationConfiguration(); $confObj = new EmailConfiguration(); $this->mailType = $confObj->getMailType(); if ($this->mailType == 'smtp') { $config = array(); $authType = $confObj->getSmtpAuth(); if ($authType != EmailConfiguration::EMAILCONFIGURATION_SMTP_AUTH_NONE) { $config['auth'] = strtolower($authType); $config['username'] = trim($confObj->getSmtpUser()); $config['password'] = trim($confObj->getSmtpPass()); } $security = $confObj->getSmtpSecurity(); if ($security != EmailConfiguration::EMAILCONFIGURATION_SMTP_SECURITY_NONE) { $config['ssl'] = strtolower($security); } $config['port'] = trim($confObj->getSmtpPort()); $transport = new Zend_Mail_Transport_Smtp($confObj->getSmtpHost(), $config); } else { if ($this->mailType = 'sendmail') { $transport = new Zend_Mail_Transport_Sendmail(); } } Zend_Mail::setDefaultTransport($transport); $this->mailer = new Zend_Mail(); $this->mailer->setFrom($confObj->getMailAddress(), "OrangeHRM"); }