Esempio n. 1
0
 function getMailer()
 {
     if (!FSS_Settings::Get('email_send_override')) {
         $mailer = JFactory::getMailer();
         $mailer->setSender($this->Get_Sender());
         $mailer->CharSet = 'UTF-8';
         return $mailer;
     }
     $smtpauth = FSS_Settings::Get('email_send_smtp_auth') == 0 ? null : 1;
     $smtpuser = FSS_Settings::Get('email_send_smtp_username');
     // $conf->get('smtpuser');
     $smtppass = FSS_Settings::Get('email_send_smtp_password');
     // $conf->get('smtppass');
     $smtphost = FSS_Settings::Get('email_send_smtp_host');
     // $conf->get('smtphost');
     $smtpsecure = FSS_Settings::Get('email_send_smtp_security');
     // $conf->get('smtpsecure');
     $smtpport = FSS_Settings::Get('email_send_smtp_port');
     // $conf->get('smtpport');
     $mailfrom = FSS_Settings::Get('email_send_from_email');
     // $conf->get('mailfrom');
     $fromname = FSS_Settings::Get('email_send_from_name');
     // $conf->get('fromname');
     $mailer = FSS_Settings::Get('email_send_mailer');
     // $conf->get('mailer');
     // Create a JMail object
     $mail = new JMail();
     // Set default sender without Reply-to
     $mail->SetFrom(JMailHelper::cleanLine($mailfrom), JMailHelper::cleanLine($fromname), 0);
     // Default mailer is to use PHP's mail function
     switch ($mailer) {
         case 'smtp':
             $mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport);
             break;
         case 'sendmail':
             $mail->IsSendmail();
             break;
         default:
             $mail->IsMail();
             break;
     }
     $mail->CharSet = 'UTF-8';
     return $mail;
 }