Example #1
0
 public function test_that_it_can_set_and_get_from_address()
 {
     $fromAddress = '*****@*****.**';
     $fromName = 'From';
     $this->message->addFrom($fromAddress, $fromName);
     $from = $this->message->getFrom();
     $this->assertTrue($fromAddress === $from[0]['address'] && $fromName === $from[0]['name']);
 }
 /**
  * Sets the From addresses
  *
  * @param Message       $message      The mail message
  * @param Swift_Message $swiftMessage The Swift Mailer message
  *
  * @return void
  */
 protected function setFrom(Message $message, Swift_Message $swiftMessage)
 {
     foreach ($message->getFrom() as $from) {
         $swiftMessage->addFrom($from['address'], $from['name']);
     }
 }