Beispiel #1
0
	private function initSmtpTransport()
	{
		$config = Zend_Registry::get('config')->mail;
		if ( empty($config->host) 
			 || $config->transport != 'smtp')
		{
			return;
		}
		$smtpConfig = array();
		if ( !empty($config->type)
			 || !empty($config->username)
			 || !empty($config->password)
			 || !empty($config->encryption)
		)
		{
			$smtpConfig = array(
				'auth' => strtolower($config->type),
				'username' => $config->username,
				'password' => $config->password,
				'ssl' => $config->encryption,
			);
		}
		
		$tr = new Zend_Mail_Transport_Smtp($config->host, $smtpConfig);
		Piwik_Mail::setDefaultTransport($tr);
		ini_set("smtp_port", $config->port);
	}
Beispiel #2
0
 /**
  * @return void
  */
 private function initSmtpTransport()
 {
     $mailConfig = Piwik_Config::getInstance()->mail;
     if (empty($mailConfig['host']) || $mailConfig['transport'] != 'smtp') {
         return;
     }
     $smtpConfig = array();
     if (!empty($mailConfig['type'])) {
         $smtpConfig['auth'] = strtolower($mailConfig['type']);
     }
     if (!empty($mailConfig['username'])) {
         $smtpConfig['username'] = $mailConfig['username'];
     }
     if (!empty($mailConfig['password'])) {
         $smtpConfig['password'] = $mailConfig['password'];
     }
     if (!empty($mailConfig['encryption'])) {
         $smtpConfig['ssl'] = $mailConfig['encryption'];
     }
     $tr = new Zend_Mail_Transport_Smtp($mailConfig['host'], $smtpConfig);
     Piwik_Mail::setDefaultTransport($tr);
     ini_set("smtp_port", $mailConfig['port']);
 }