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


PHP Swift_Message::addFrom方法代码示例

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


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

示例1: action_send

 /**
  * This is just for the demo sending.
  */
 public function action_send()
 {
     $message = new Swift_Message();
     $message->addTo($this->request->post('to'));
     $message->addFrom($this->request->post('from'));
     $message->setSubject($this->request->post('subject'));
     $message->setBody($this->request->post('message'));
     $mq = new MailQueue();
     $mq->add($message);
     $this->redirect('mailqueue/demo');
 }
开发者ID:samwilson,项目名称:kohana_mailqueue,代码行数:14,代码来源:MailQueue.php

示例2: postPersist

 public function postPersist(LifecycleEventArgs $args)
 {
     $entity = $args->getEntity();
     // On veut envoyer un email que pour les entités Application
     if (!$entity instanceof Application) {
         return;
     }
     $message = new \Swift_Message('Nouvelle candidature', 'Vous avez reçu une nouvelle candidature.');
     $message->addFrom('admin@votresite.com');
     //$this->mailer->send($message);
 }
开发者ID:vincentmary,项目名称:oc_sf,代码行数:11,代码来源:ApplicationNotification.php

示例3: sendMessage

 private function sendMessage($url, $username)
 {
     $message = new \Swift_Message('Vous avez reçu une demande!', "Félicitation, nous venons d'apprendre que {$username} est interessé par votre annonce:\n\n{$url}\n\nL'équipe Snoozit.\n         ");
     $message->addFrom('gautierkris@gmail.com')->addTo('gautierkris@gmail.com');
     $this->mailer->send($message);
 }
开发者ID:GautierKris,项目名称:Snoozit,代码行数:6,代码来源:NegoceNotification.php

示例4: addFrom

 /**
  * {@inheritdoc}
  *
  * @return $this|self
  */
 public function addFrom($address, $name = null) : self
 {
     $this->message->addFrom($address, $name);
     return $this;
 }
开发者ID:cawaphp,项目名称:email,代码行数:10,代码来源:Message.php

示例5: addFrom

 public function addFrom(Email $email)
 {
     $this->message->addFrom($email->email, $email->name);
     return $this;
 }
开发者ID:Webiny,项目名称:Framework,代码行数:5,代码来源:Message.php

示例6: setupMessageHeaders

 /**
  * @param \Swift_Message $instance
  * @param  array  $from              From addresses. An array of (email-address => name)
  * @param  array  $to                To addresses. An array of (email-address => name)
  * @param  array  $cc                Cc addresses. An array of (email-address => name) [optional]
  * @param  array  $bcc               Bcc addresses. An array of (email-address => name) [optional]
  * @param  array  $replyTo           Reply to addresses. An array of (email-address => name) [optional]
  */
 protected function setupMessageHeaders($instance, $from, $to, $cc = [], $bcc = [], $replyTo = [])
 {
     // Add from addresses
     foreach ($from as $address => $name) {
         $instance->addFrom($address, $name);
     }
     // Add to addresses
     foreach ($to as $address => $name) {
         $instance->addTo($address, $name);
     }
     // Add cc addresses
     foreach ($cc as $address => $name) {
         $instance->addCc($address, $name);
     }
     // Add bcc addresses
     foreach ($bcc as $address => $name) {
         $instance->addBcc($address, $name);
     }
     // Add reply to addresses
     foreach ($replyTo as $address => $name) {
         $instance->addReplyTo($address, $name);
     }
 }
开发者ID:vigourouxjulien,项目名称:thelia,代码行数:31,代码来源:MailerFactory.php

示例7: finishOrderViaTheForm

 public function finishOrderViaTheForm(FormInterface $form)
 {
     $cart = $this->loadCart();
     /** @var OrderEntity $entity */
     $entity = $form->getData();
     $entity->cart = $cart;
     try {
         $this->entity_manager->persist($entity);
         $this->entity_manager->flush();
         $data = ['name' => $entity->name, 'email' => $entity->email, 'cart' => $entity->cart, 'note' => $entity->note];
         $message = new \Swift_Message('Objednávka z webu Symfony.cz');
         $message->addFrom('symfony-eshop@zemistr.eu');
         $message->addTo($entity->email);
         $message->setBody($this->twig->render('AppBundle:Cart:email.html.twig', $data), 'text/html');
         $this->swift_mailer->send($message, $failed);
         $message = new \Swift_Message('Nová objednávka z webu Symfony.cz');
         $message->addFrom('symfony-eshop@zemistr.eu');
         $message->addTo('symfony-eshop@zemistr.eu');
         $message->setBody($this->twig->render('AppBundle:Cart:emailAdmin.html.twig', $data), 'text/html');
         $this->swift_mailer->send($message, $failed);
         $this->storeCart([]);
         return self::STATUS_OK;
     } catch (\Exception $e) {
     }
     return self::STATUS_ERROR;
 }
开发者ID:Zemistr,项目名称:symfony-3-first-app,代码行数:26,代码来源:OrderService.php


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