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


PHP Mailer::failures方法代码示例

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


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

示例1: handle

 /**
  * Handle the command.
  *
  * @param ContactFormBuilder $builder
  * @param MessageBag         $messages
  * @param Mailer             $mailer
  */
 public function handle(ContactFormBuilder $builder, MessageBag $messages, Mailer $mailer)
 {
     // Validation failed!
     if ($builder->hasFormErrors()) {
         return;
     }
     // Delegate these for now.
     $view = $this->dispatch(new GetMessageView($builder));
     $data = $this->dispatch(new GetMessageData($builder));
     // Build the message object.
     $message = function (Message $message) use($builder) {
         $this->dispatch(new BuildMessage($message, $builder));
     };
     // Send the email.
     $mailer->send($view, $data, $message);
     // If there are any failures, report.
     if (count($mailer->failures()) > 0) {
         $messages->error($builder->getFormOption('error_message', 'anomaly.plugin.contact::error.send_message'));
     } else {
         // Otherwise, show success.
         $messages->success($builder->getFormOption('success_message', 'anomaly.plugin.contact::success.send_message'));
     }
     // Clear the form!
     $builder->resetForm();
 }
开发者ID:anomalylabs,项目名称:contact-plugin,代码行数:32,代码来源:ContactFormHandler.php

示例2: handle

 /**
  * Handle the command.
  *
  * @param Mailer     $mailer
  * @param Repository $config
  * @return bool
  */
 public function handle(Mailer $mailer, Repository $config)
 {
     $path = $this->dispatch(new GetResetPasswordPath($this->user, $this->redirect));
     $mailer->send('anomaly.module.users::message/reset', compact('user', 'path'), function (Message $message) use($config) {
         $message->subject('Reset your password')->to($this->user->getEmail(), $this->user->getDisplayName())->from($config->get('mail.from.address', 'noreply@localhost'));
     });
     return empty($mailer->failures());
 }
开发者ID:jacksun101,项目名称:users-module,代码行数:15,代码来源:SendResetEmail.php

示例3: sendMail

 /**
  * Send a simple email
  *
  * For more complex emails you might write another method
  *
  * @throws MailException Throws an exception containing further information as message
  * @return void
  */
 public function sendMail()
 {
     try {
         $this->mail->send($this->view, $this->data, function ($message) {
             $message->from($this->from['address'], $this->from['name']);
             $message->to($this->to['address'], $this->to['name'])->subject($this->subject);
         });
         if ($this->mail->failures() != array()) {
             throw new MailException($this->mailErrorMessage);
         }
     } catch (Swift_TransportException $e) {
         $this->handleTransportExceptions($e);
     }
 }
开发者ID:LaraGit,项目名称:larapress,代码行数:22,代码来源:Narrator.php

示例4: failures

 /**
  * Get the array of failed recipients.
  *
  * @return array 
  * @static 
  */
 public static function failures()
 {
     return \Illuminate\Mail\Mailer::failures();
 }
开发者ID:satriashp,项目名称:tour,代码行数:10,代码来源:_ide_helper.php

示例5: failures

 /**
  * Get the array of failed recipients.
  *
  *
  */
 public function failures()
 {
     return $this->mailer->failures();
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:9,代码来源:ThemeMailer.php


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