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


PHP Mail::__construct方法代码示例

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


在下文中一共展示了Mail::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($to, $from, $reply_to, $subject, $body)
 {
     // call default constructor
     parent::__construct($to, $from, $reply_to, $subject, $body);
     // set different header with HTML information
     $this->update_header();
 }
开发者ID:Ruben-Verma,项目名称:Abfrage3Web,代码行数:7,代码来源:mail.class.php

示例2:

 /**
  * Constructor.
  *
  * Instantiates a new Mail_mock:: object based on the parameters
  * passed in. It looks for the following parameters, both optional:
  *     preSendCallback   Called before an email would be sent.
  *     postSendCallback  Called after an email would have been sent.
  *
  * @param array Hash containing any parameters.
  * @access public
  */
 function __construct($params)
 {
     parent::__construct();
     if (isset($params['preSendCallback']) && is_callable($params['preSendCallback'])) {
         $this->_preSendCallback = $params['preSendCallback'];
     }
     if (isset($params['postSendCallback']) && is_callable($params['postSendCallback'])) {
         $this->_postSendCallback = $params['postSendCallback'];
     }
 }
开发者ID:phpsa,项目名称:TheHostingTool,代码行数:21,代码来源:mock.php

示例3: isset

 /**
  * Constructor.
  * @param $emailKey string unique identifier for the template
  * @param $locale string locale of the template
  * @param $includeSignature boolean optional
  */
 function __construct($emailKey = null, $locale = null, $context = null, $includeSignature = true)
 {
     parent::__construct();
     $this->emailKey = isset($emailKey) ? $emailKey : null;
     // If a context wasn't specified, use the current request.
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     if ($context === null) {
         $context = $request->getContext();
     }
     $this->includeSignature = $includeSignature;
     // Use current user's locale if none specified
     $this->locale = isset($locale) ? $locale : AppLocale::getLocale();
     // Record whether or not to BCC the sender when sending message
     $this->bccSender = $request->getUserVar('bccSender');
     $this->addressFieldsEnabled = true;
     if (isset($this->emailKey)) {
         $emailTemplateDao = DAORegistry::getDAO('EmailTemplateDAO');
         $emailTemplate = $emailTemplateDao->getEmailTemplate($this->emailKey, $this->locale, $context == null ? 0 : $context->getId());
     }
     $userSig = '';
     $user = defined('SESSION_DISABLE_INIT') ? null : $request->getUser();
     if ($user && $this->includeSignature) {
         $userSig = $user->getLocalizedSignature();
         if (!empty($userSig)) {
             $userSig = "<br/>" . $userSig;
         }
     }
     if (isset($emailTemplate)) {
         $this->setSubject($emailTemplate->getSubject());
         $this->setBody($emailTemplate->getBody() . $userSig);
         $this->enabled = $emailTemplate->getEnabled();
     } else {
         $this->setBody($userSig);
         $this->enabled = true;
     }
     // Default "From" to user if available, otherwise site/context principal contact
     $this->emailHeader = '';
     if ($user) {
         $this->setFrom($user->getEmail(), $user->getFullName());
     } elseif (is_null($context) || is_null($context->getSetting('contactEmail'))) {
         $site = $request->getSite();
         $this->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
     } else {
         $this->setFrom($context->getSetting('contactEmail'), $context->getSetting('contactName'));
         $this->emailHeader = $context->getSetting('emailHeader');
     }
     if ($context) {
         $this->setSubject('[' . $context->getLocalizedAcronym() . '] ' . $this->getSubject());
     }
     $this->context = $context;
     $this->params = array();
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:59,代码来源:MailTemplate.inc.php

示例4: __construct

 /**
  * Constructor
  * 
  * @param mixed $content Lang instance or subject as string
  */
 public function __construct($content = 'No subject')
 {
     $use_html = Config::get('email_use_html');
     // Cast content to string if translation object
     $subject = $content instanceof Translation ? (string) $content->subject : $content;
     // Trigger basic mail build
     parent::__construct(null, $subject, $use_html);
     // Write content if a translation object was given
     if ($content instanceof Translation) {
         $this->writePlain($content->plain);
         if ($use_html) {
             $this->writeHTML($content->html);
         }
     }
 }
开发者ID:eheb,项目名称:renater-foodle,代码行数:20,代码来源:ApplicationMail.class.php

示例5: strpos

 /**
  * Constructor.
  *
  * Instantiates a new Mail_sendmail:: object based on the parameters
  * passed in. It looks for the following parameters:
  *     sendmail_path    The location of the sendmail binary on the
  *                      filesystem. Defaults to '/usr/sbin/sendmail'.
  *
  *     sendmail_args    Any extra parameters to pass to the sendmail
  *                      or sendmail wrapper binary.
  *
  * If a parameter is present in the $params array, it replaces the
  * default.
  *
  * @param array $params Hash containing any parameters different from the
  *              defaults.
  * @access public
  */
 function __construct($params)
 {
     parent::__construct();
     if (isset($params['sendmail_path'])) {
         $this->sendmail_path = $params['sendmail_path'];
     }
     if (isset($params['sendmail_args'])) {
         $this->sendmail_args = $params['sendmail_args'];
     }
     /*
      * Because we need to pass message headers to the sendmail program on
      * the commandline, we can't guarantee the use of the standard "\r\n"
      * separator.  Instead, we use the system's native line separator.
      */
     if (defined('PHP_EOL')) {
         $this->sep = PHP_EOL;
     } else {
         $this->sep = strpos(PHP_OS, 'WIN') === false ? "\n" : "\r\n";
     }
 }
开发者ID:phpsa,项目名称:TheHostingTool,代码行数:38,代码来源:sendmail.php

示例6: join

 /**
  * Constructor.
  *
  * Instantiates a new Mail_mail:: object based on the parameters
  * passed in.
  *
  * @param array $params Extra arguments for the mail() function.
  */
 function __construct($params = null)
 {
     parent::__construct();
     // The other mail implementations accept parameters as arrays.
     // In the interest of being consistent, explode an array into
     // a string of parameter arguments.
     if (is_array($params)) {
         $this->_params = join(' ', $params);
     } else {
         $this->_params = $params;
     }
     /* Because the mail() function may pass headers as command
      * line arguments, we can't guarantee the use of the standard
      * "\r\n" separator.  Instead, we use the system's native line
      * separator. */
     if (defined('PHP_EOL')) {
         $this->sep = PHP_EOL;
     } else {
         $this->sep = strpos(PHP_OS, 'WIN') === false ? "\n" : "\r\n";
     }
 }
开发者ID:phpsa,项目名称:TheHostingTool,代码行数:29,代码来源:mail.php

示例7: __construct

 /**
  * Constructor
  * 
  * @param mixed $content Lang instance or subject as string
  */
 public function __construct($content = 'No subject')
 {
     $use_html = Config::get('email_use_html');
     // Cast content to string if translation object
     $subject = $content instanceof Translation ? $content->subject : $content;
     if ($subject instanceof Translation) {
         $subject = $subject->out();
     }
     if (is_array($subject)) {
         $subject = array_filter($subject);
         $subject = $subject['prefix'] . ' ' . array_pop($subject);
     }
     // Trigger basic mail build
     parent::__construct(null, $subject, $use_html);
     // Write content if a translation object was given
     if ($content instanceof Translation) {
         $this->writePlain($content->plain);
         if ($use_html) {
             $this->writeHTML($content->html);
         }
     }
 }
开发者ID:eheb,项目名称:renater-decide,代码行数:27,代码来源:ApplicationMail.class.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setSubject(static::SUBJECT);
 }
开发者ID:threestarsgenius,项目名称:homework,代码行数:5,代码来源:Contact.php

示例9:

 /**
  * Constructor.
  *
  * Instantiates a new Mail_smtp:: object based on the parameters
  * passed in. It looks for the following parameters:
  *     host        The server to connect to. Defaults to localhost.
  *     port        The port to connect to. Defaults to 25.
  *     auth        SMTP authentication.  Defaults to none.
  *     username    The username to use for SMTP auth. No default.
  *     password    The password to use for SMTP auth. No default.
  *     localhost   The local hostname / domain. Defaults to localhost.
  *     timeout     The SMTP connection timeout. Defaults to none.
  *     verp        Whether to use VERP or not. Defaults to false.
  *                 DEPRECATED as of 1.2.0 (use setMailParams()).
  *     debug       Activate SMTP debug mode? Defaults to false.
  *     persist     Should the SMTP connection persist?
  *     pipelining  Use SMTP command pipelining
  *
  * If a parameter is present in the $params array, it replaces the
  * default.
  *
  * @param array Hash containing any parameters different from the
  *              defaults.
  * @access public
  */
 function __construct($params)
 {
     parent::__construct();
     if (isset($params['host'])) {
         $this->host = $params['host'];
     }
     if (isset($params['port'])) {
         $this->port = $params['port'];
     }
     if (isset($params['auth'])) {
         $this->auth = $params['auth'];
     }
     if (isset($params['username'])) {
         $this->username = $params['username'];
     }
     if (isset($params['password'])) {
         $this->password = $params['password'];
     }
     if (isset($params['localhost'])) {
         $this->localhost = $params['localhost'];
     }
     if (isset($params['timeout'])) {
         $this->timeout = $params['timeout'];
     }
     if (isset($params['debug'])) {
         $this->debug = (bool) $params['debug'];
     }
     if (isset($params['persist'])) {
         $this->persist = (bool) $params['persist'];
     }
     if (isset($params['pipelining'])) {
         $this->pipelining = (bool) $params['pipelining'];
     }
     // Deprecated options
     if (isset($params['verp'])) {
         $this->addServiceExtensionParameter('XVERP', is_bool($params['verp']) ? null : $params['verp']);
     }
 }
开发者ID:phpsa,项目名称:TheHostingTool,代码行数:63,代码来源:smtp.php


注:本文中的Mail::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。