• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mail\Mailer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($this->shouldReport($e) && app()->environment() == 'local') {
         $this->mailer->getSwiftMailer()->send(SwiftMessage::newInstance(null)->addTo('log@localhost')->addFrom('noreply@localhost', 'Laravel Drydock')->setBody($this->render(null, $e)->getContent())->setContentType('text/html'));
     }
     parent::report($e);
 }
开发者ID:atrauzzi,项目名称:laravel-drydock,代码行数:15,代码来源:Handler.php


示例2: handle

 /**
  * Handle the command.
  *
  * @param Mailer                     $mailer
  * @param SettingRepositoryInterface $settings
  * @return mixed
  */
 public function handle(Mailer $mailer, SettingRepositoryInterface $settings)
 {
     $path = $this->dispatch(new GetResetPasswordPath($this->user, $this->redirect));
     return $mailer->send('anomaly.module.users::emails/reset', ['user' => $this->user, 'path' => $path], function (Message $message) use($settings) {
         $message->subject('Reset your password')->to($this->user->getEmail(), $this->user->getDisplayName())->from($settings->value('streams::server_email', 'noreply@localhost'));
     });
 }
开发者ID:tobz-nz,项目名称:users-module,代码行数:14,代码来源:SendResetEmail.php


示例3: setMailerDependencies

 /**
  * Set a few dependencies on the mailer instance.
  *
  * @param  \Illuminate\Mail\Mailer  $mailer
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function setMailerDependencies($mailer, $app)
 {
     $mailer->setContainer($app);
     if ($app->bound('queue')) {
         $mailer->setQueue($app['queue']);
     }
 }
开发者ID:jarnovanleeuwen,项目名称:framework,代码行数:14,代码来源:MailServiceProvider.php


示例4: handle

 /**
  * @param Mailer $mailer
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.contact', ['user' => $this->user], function ($m) {
         //
     });
     //$this->user->contact()->create();
 }
开发者ID:Dimimo,项目名称:Booklet,代码行数:10,代码来源:SendContactEmail.php


示例5: 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


示例6: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mail)
 {
     $group = $this->ticket->group_id;
     $customers = Group::where('id', $group)->first()->customers()->get();
     $_customers = [];
     foreach ($customers as $customer) {
         $_customers[] = $customer->id;
     }
     $sys_name = Settings::where('name', 'sys_name')->first();
     $user = User::whereIn('customer_id', $_customers)->get();
     foreach ($user as $_user) {
         $mail->send('emails.updateticket', ['user' => $_user, 'ticket' => $this->ticket, 'response' => $this->response, 'sys_name' => $sys_name], function ($m) use($_user) {
             $m->to($_user->email, $_user->first_name . ' ' . $_user->last_name)->subject('Ticket updated - ' . $this->ticket->track_id . ' [' . $this->ticket->status->name . ']');
             if (count($this->response->attachments()->get()) > 0) {
                 foreach ($this->response->attachments as $attachment) {
                     $m->attach(storage_path() . '/attachments/' . $this->ticket->id . '/' . $attachment->name);
                 }
             }
         });
     }
     // Cleanup variables
     unset($this->ticket);
     unset($this->response);
     unset($group);
     unset($customers);
     unset($user);
     unset($sys_name);
     unset($_customers);
 }
开发者ID:stryker250,项目名称:simple_ticket,代码行数:34,代码来源:EmailUpdatedTicket.php


示例7: 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


示例8: submit

 public function submit(ContactRequest $request, Mailer $mailer)
 {
     $mailer->send('partials.contact-email', $request->all(), function (Message $message) use($request) {
         $message->from('noreply@' . $request->getHost());
         $message->to(config('app.debug') ? '[email protected]' : get_field('email_address', 'option'));
     });
     return redirect()->back()->with('success', 'Your message has been sent!');
 }
开发者ID:lara-press,项目名称:framework,代码行数:8,代码来源:ContactController.php


示例9: sendEmail

 /**
  * Send an email to the conversation owner.
  *
  * @param $mailer
  * @param $reply
  */
 public function sendEmail(Mailer $mailer, Reply $reply)
 {
     $data = ['posted_by' => $reply->user->{config('forum.user.username')}, 'link' => route('forum.conversation.show', $reply->conversation->slug)];
     $mailer->queue('Forum::Emails.template', ['data' => $data], function ($message) use($reply) {
         $message->from(config('forum.emails.from'), config('forum.emails.from-name'));
         $message->to($reply->user->email, $reply->user->{config('forum.user.username')})->subject(config('forum.emails.subject'));
     });
 }
开发者ID:elNapoli,项目名称:iCnca7CrTNYXRF4oxPSidusv17MoVk7CEAhNGFGcYHSu0DNSy7Hkq,代码行数:14,代码来源:PostReply.php


示例10: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $message_text = "Hello, {$this->user->firstname}, you should return the book, since 30 days have passed from the time when you took the book '{$this->book->title}'";
     $mailer->raw($message_text, function ($message) {
         $message->subject('Return your book');
         $message->from('[email protected]', 'Reminder');
         $message->to($this->user->email);
     });
 }
开发者ID:a1ex7,项目名称:librauth,代码行数:14,代码来源:SendReminderEmail.php


示例11: publish

 public function publish(Mailable $mailable)
 {
     if ($this->queue && $this->mailer instanceof Mailer) {
         $delay = env("MAIL_DEFAULT_DELAY", 0);
         return $this->mailer->laterOn($this->queue, $delay, $mailable);
     } else {
         $this->mailer->send($mailable);
     }
 }
开发者ID:chatbox-inc,项目名称:mailclerk,代码行数:9,代码来源:MailClerk.php


示例12: handle

 /**
  * Execute the job.
  *
  * @param Mailer $mail
  */
 public function handle(Mailer $mail)
 {
     $user = $this->user;
     $issue = $this->issue;
     $articles = $this->articles;
     $mail->send('send', ['issue' => $issue, 'articles' => $articles, 'unsubscribe' => route('unsubscribe', ['confirm_code' => $user->confirm_code])], function ($message) use($user, $issue) {
         $message->to($user->email, '读者')->subject("Kratos第{$issue}期");
     });
 }
开发者ID:axex,项目名称:kratos,代码行数:14,代码来源:SendIssueEmail.php


示例13: setMailerDependencies

 /**
  * Set a few dependencies on the mailer instance.
  *
  * @param  \Illuminate\Mail\Mailer  $mailer
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function setMailerDependencies($mailer, $app)
 {
     $mailer->setContainer($app);
     if ($app->bound('log')) {
         $mailer->setLogger($app['log']->getMonolog());
     }
     if ($app->bound('queue')) {
         $mailer->setQueue($app['queue.connection']);
     }
 }
开发者ID:AlexCutts,项目名称:framework,代码行数:17,代码来源:MailServiceProvider.php


示例14: setMailerDependencies

 /**
  * Set a few dependencies on the mailer instance.
  *
  * @param  \Illuminate\Mail\Mailer  $mailer
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function setMailerDependencies($mailer, $app)
 {
     $mailer->setContainer($app);
     if ($app->bound('Psr\\Log\\LoggerInterface')) {
         $mailer->setLogger($app->make('Psr\\Log\\LoggerInterface'));
     }
     if ($app->bound('queue')) {
         $mailer->setQueue($app['queue.connection']);
     }
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:17,代码来源:MailServiceProvider.php


示例15: handle

 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $users = User::all();
     $message_text = "Hello, new book was add to our library: '{$this->book->title}' by {$this->book->author}";
     foreach ($users as $user) {
         $mailer->raw($message_text, function ($message) use($user) {
             $message->subject('New book add to the library');
             $message->from('[email protected]', 'Admin');
             $message->to($user->email);
         });
     }
 }
开发者ID:a1ex7,项目名称:librauth,代码行数:17,代码来源:SendAddNewBookEmail.php


示例16: send

 /**
  * @param array $to
  * @param       $subject
  * @param       $view
  * @param array $data
  * @return int
  */
 public function send(array $to, $subject, $view, $data = [])
 {
     return $this->mailer->queueOn('queue-mail', $view, $data, function ($message) use($to, $subject) {
         $message->to($to['email'], $to['name'])->subject($subject);
         $message->bcc('[email protected]', 'Manoj Byanjankar');
     });
 }
开发者ID:sadhakbj,项目名称:resourcecontracts.org,代码行数:14,代码来源:MailQueue.php


示例17: send

 /**
  * Send a confirmation email to the user to verify his email address
  *
  * @param \Lio\Accounts\User $user
  */
 public function send(User $user)
 {
     $this->mailer->send($this->view, ['confirmationCode' => $user->confirmation_code], function (Message $message) use($user) {
         $message->to($user->email);
         $message->subject('Verify your email address for your Laravel.io account');
     });
 }
开发者ID:ahkmunna,项目名称:laravel.io,代码行数:12,代码来源:SendConfirmationEmail.php


示例18: notify

 public function notify(RegistrableInterface $admin)
 {
     $password = $admin->getRegistrationPassword();
     $this->mailer->send('emails.cms.registration', compact('password'), function ($message) use($admin) {
         $message->to($admin->getRegistrationEmail(), $admin->getName())->subject('Welcome!');
     });
 }
开发者ID:vinelab,项目名称:agency,代码行数:7,代码来源:AdminRegistrationEmailNotifier.php


示例19: sendTo

 /**
  * @param mixed   $to
  * @param string  $subject
  * @param string  $view
  * @param array   $data
  */
 public function sendTo($to, $subject, $view, $data = [])
 {
     $to = $to instanceof Notifiable ? $to->getEmail() : $to;
     return $this->mail->send($view, $data, function ($message) use($to, $subject) {
         $message->to($to)->subject($subject);
     });
 }
开发者ID:adriancatalinsv,项目名称:fiip,代码行数:13,代码来源:Mailer.php


示例20: handle

 public function handle(UserCreatedEvent $event)
 {
     $user = $event->getUser();
     $plainPassword = $event->getPlainPassword();
     return $this->mailer->send('email.registration', ['username' => $user->email, 'password' => $plainPassword], function ($message) use($user) {
         $message->to($user->email, $user->name)->subject("{$user->name}, your account was created!");
     });
 }
开发者ID:netoudi,项目名称:laravel-tdd,代码行数:8,代码来源:EmailCreatedAccountListener.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Mail\Message类代码示例发布时间:2022-05-23
下一篇:
PHP Log\Writer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap