Ejemplo n.º 1
0
 /**
  * Sends the message.
  *
  * @return integer the number of recipients who were accepted for delivery
  * @author Karsten Dambekalns <*****@*****.**>
  */
 public function send()
 {
     $this->initializeMailer();
     $this->sent = TRUE;
     $this->getHeaders()->addTextHeader('X-Mailer', $this->mailerHeader);
     return $this->mailer->send($this, $this->failedRecipients);
 }
Ejemplo n.º 2
0
 /**
  * Send the given Message like it would be sent in a mail client.
  *
  * All recipients (with the exception of Bcc) will be able to see the other recipients this message was sent to.
  *
  * Recipient/sender data will be retrieved from the Message object.
  *
  * This Mailer instance will send the given message to additional transports besides the one configured via the
  * TYPO3 Mail API.
  *
  * @param Swift_Mime_Message $message The email message to send
  * @param array $failedRecipients List of (string) failed recipients e-mail addresses
  *
  * @return integer Number of recipients who were accepted for delivery
  */
 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     $sent = parent::send($message, $failedRecipients);
     // send via additional transports
     foreach ($this->extraTransports as $transport) {
         /** @var \Swift_Transport $transport */
         if (!$transport->isStarted()) {
             $transport->start();
         }
         try {
             $transport->send($message);
         } catch (\Swift_RfcComplianceException $ignored) {
         }
     }
     // return result from "main" transport
     return $sent;
 }