當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JMail::useSMTP方法代碼示例

本文整理匯總了PHP中JMail::useSMTP方法的典型用法代碼示例。如果您正苦於以下問題:PHP JMail::useSMTP方法的具體用法?PHP JMail::useSMTP怎麽用?PHP JMail::useSMTP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JMail的用法示例。


在下文中一共展示了JMail::useSMTP方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMailer

 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;
 }
開發者ID:vstorm83,項目名稱:propertease,代碼行數:44,代碼來源:mailer.php


注:本文中的JMail::useSMTP方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。