| @@ 92-100 (lines=9) @@ | ||
| 89 | * |
|
| 90 | * @return MessageInterface |
|
| 91 | */ |
|
| 92 | public function setFrom($emailAddress, $name = null) |
|
| 93 | { |
|
| 94 | $address = new AddressList\Address($emailAddress, $name); |
|
| 95 | $from = (new AddressList('From'))->add($address); |
|
| 96 | $this->addHeader('From', $from); |
|
| 97 | $sender = new GenericHeader('Sender', (string) $address); |
|
| 98 | $this->addHeader('Sender', $sender); |
|
| 99 | return $this; |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * Access the address list of the From header. |
|
| @@ 152-160 (lines=9) @@ | ||
| 149 | * |
|
| 150 | * @return MessageInterface |
|
| 151 | */ |
|
| 152 | public function addTo($email, $name = null) |
|
| 153 | { |
|
| 154 | $address = new AddressList\Address($email, $name); |
|
| 155 | /** @var AddressListInterface $toHeader */ |
|
| 156 | $toHeader = $this->getHeader('To', new AddressList('To')); |
|
| 157 | $toHeader->add($address); |
|
| 158 | $this->addHeader('To', $toHeader); |
|
| 159 | return $this; |
|
| 160 | } |
|
| 161 | ||
| 162 | /** |
|
| 163 | * Add a "Cc" address |
|