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


PHP mail::is_existent_maildomain方法代碼示例

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


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

示例1: send

 function send()
 {
     global $tpl, $opt, $login;
     if (!$this->template_exists($this->name . '.tpl')) {
         $tpl->error(ERROR_MAIL_TEMPLATE_NOT_FOUND);
     }
     $this->assign('template', $this->name);
     $optn['mail']['contact'] = $opt['mail']['contact'];
     $optn['page']['absolute_url'] = $opt['page']['absolute_url'];
     $optn['format'] = $opt['locale'][$opt['template']['locale']]['format'];
     $this->assign('opt', $optn);
     $this->assign('to', $this->to);
     $this->assign('from', $this->from);
     $this->assign('subject', $this->subject);
     $llogin['username'] = isset($login) ? $login->username : '';
     $this->assign('login', $llogin);
     $body = $this->fetch($this->main_template . '.tpl', '', $this->get_compile_id());
     // check if the target domain exists if the domain does not
     // exist, the mail is sent to the own domain (?!)
     $domain = mail::getToMailDomain($this->to);
     if (mail::is_existent_maildomain($domain) == false) {
         return false;
     }
     $aAddHeaders = array();
     $aAddHeaders[] = 'From: "' . $this->from . '" <' . $this->from . '>';
     if ($this->replyTo !== null) {
         $aAddHeaders[] = 'Reply-To: ' . $this->replyTo;
     }
     if ($this->returnPath !== null) {
         $aAddHeaders[] = 'Return-Path: ' . $this->returnPath;
     }
     $mailheaders = implode("\n", array_merge($aAddHeaders, $this->headers));
     return mb_send_mail($this->to, $opt['mail']['subject'] . $this->subject, $body, $mailheaders);
 }
開發者ID:RH-Code,項目名稱:opencaching,代碼行數:34,代碼來源:mail.class.php

示例2: send

 function send($page_url = false)
 {
     global $tpl, $opt;
     if (!$this->template_exists($this->name . '.tpl')) {
         $tpl->error(ERROR_MAIL_TEMPLATE_NOT_FOUND);
     }
     $this->assign('template', $this->name);
     if (!$this->recipient_locale) {
         $this->recipient_locale = $opt['template']['locale'];
     }
     $optn['mail']['contact'] = $opt['mail']['contact'];
     $optn['page']['absolute_url'] = $page_url ? $page_url : $opt['page']['absolute_url'];
     $optn['page']['sitename'] = $opt['page']['sitename'];
     $optn['format'] = $opt['locale'][$this->recipient_locale]['format'];
     $this->assign('opt', $optn);
     $this->assign('to', $this->to);
     $this->assign('from', $this->from);
     $this->assign('subject', $this->subject);
     // This is nasty, but as there is only a global translation system
     // (based on gettext) and there are no precompiled, language-dependend email
     // templates available, we must temporarily change the locale according to
     // the recipient's locale. If some error occurs while running fetch(),
     // the error message may be displayed in the recipient's language.
     $sender_locale = $opt['template']['locale'];
     if ($this->recipient_locale != $sender_locale) {
         $opt['template']['locale'] = $this->recipient_locale;
         set_php_locale();
     }
     $body = $this->fetch($this->main_template . '.tpl', '', $this->get_compile_id());
     if ($this->recipient_locale != $sender_locale) {
         $opt['template']['locale'] = $sender_locale;
         set_php_locale();
     }
     // check if the target domain exists if the domain does not
     // exist, the mail is sent to the own domain (?!)
     $domain = mail::getToMailDomain($this->to);
     if (mail::is_existent_maildomain($domain) == false) {
         return false;
     }
     $aAddHeaders = array();
     $aAddHeaders[] = 'From: "' . $this->from . '" <' . $this->from . '>';
     if ($this->replyTo !== null) {
         $aAddHeaders[] = 'Reply-To: ' . $this->replyTo;
     }
     if ($this->returnPath !== null) {
         $aAddHeaders[] = 'Return-Path: ' . $this->returnPath;
     }
     $mailheaders = implode("\n", array_merge($aAddHeaders, $this->headers));
     return mb_send_mail($this->to, $opt['mail']['subject'] . $this->subject, $body, $mailheaders);
 }
開發者ID:PaulinaKowalczuk,項目名稱:oc-server3,代碼行數:50,代碼來源:mail.class.php


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