setFrom() 공개 메소드

It is permissible for multiple From addresses to be set using an array. If multiple From addresses are used, you SHOULD set the Sender address and according to RFC 2822, MUST set the sender address. An array can be used if display names are to be provided: i.e. array('email@address.com' => 'Real Name'). If the second parameter is provided and the first is a string, then $name is associated with the address.
public setFrom ( mixed $addresses, string $name = null )
$addresses mixed
$name string optional
예제 #1
0
 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     if (!$message->getFrom()) {
         if ($from = self::getDefaultFrom()) {
             $message->setFrom($from);
         }
     }
     if ($this->wa_set_transport) {
         $this->_transport = self::getTransportByEmail(key($message->getFrom()));
     }
     return parent::send($message, $failedRecipients);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function from(string $address, string $name = null) : MessageContract
 {
     $this->swift->setFrom($address, $name);
     return $this;
 }
예제 #3
0
 protected function _addProjectEmailAddress(Swift_Mime_Message $message, TBGProject $project = null)
 {
     if ($project instanceof TBGProject) {
         $address = TBGSettings::get(self::SETTING_PROJECT_FROM_ADDRESS . $project->getID(), 'mailing');
         $name = TBGSettings::get(self::SETTING_PROJECT_FROM_NAME . $project->getID(), 'mailing');
         if ($address != '') {
             $message->setFrom($address, $name);
         }
     }
 }