当前位置: 首页>>代码示例>>PHP>>正文


PHP mail::getToMailDomain方法代码示例

本文整理汇总了PHP中mail::getToMailDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP mail::getToMailDomain方法的具体用法?PHP mail::getToMailDomain怎么用?PHP mail::getToMailDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mail的用法示例。


在下文中一共展示了mail::getToMailDomain方法的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::getToMailDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。