|
|
@@ -109,7 +109,7 @@ class Email implements JsonSerializable, Serializable
|
|
|
protected $_sender = [];
|
|
|
|
|
|
/**
|
|
|
- * The email the recipient will reply to
|
|
|
+ * List of email(s) that the recipient will reply to.
|
|
|
*
|
|
|
* @var array
|
|
|
*/
|
|
|
@@ -478,7 +478,7 @@ class Email implements JsonSerializable, Serializable
|
|
|
*/
|
|
|
public function setReplyTo($email, $name = null)
|
|
|
{
|
|
|
- return $this->_setEmailSingle('_replyTo', $email, $name, 'Reply-To requires only 1 email address.');
|
|
|
+ return $this->_setEmail('_replyTo', $email, $name);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1168,10 +1168,19 @@ class Email implements JsonSerializable, Serializable
|
|
|
'replyTo' => 'Reply-To',
|
|
|
'readReceipt' => 'Disposition-Notification-To',
|
|
|
'returnPath' => 'Return-Path',
|
|
|
+ 'to' => 'To',
|
|
|
+ 'cc' => 'Cc',
|
|
|
+ 'bcc' => 'Bcc',
|
|
|
];
|
|
|
- foreach ($relation as $var => $header) {
|
|
|
- if ($include[$var]) {
|
|
|
- $var = '_' . $var;
|
|
|
+ $headerMultipleEmails = ['to', 'cc', 'bcc', 'replyTo'];
|
|
|
+ foreach ($relation as $key => $header) {
|
|
|
+ $var = '_' . $key;
|
|
|
+ if (!$include[$key]) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (in_array($key, $headerMultipleEmails, true)) {
|
|
|
+ $headers[$header] = implode(', ', $this->_formatAddress($this->{$var}));
|
|
|
+ } else {
|
|
|
$headers[$header] = current($this->_formatAddress($this->{$var}));
|
|
|
}
|
|
|
}
|
|
|
@@ -1183,13 +1192,6 @@ class Email implements JsonSerializable, Serializable
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- foreach (['to', 'cc', 'bcc'] as $var) {
|
|
|
- if ($include[$var]) {
|
|
|
- $classVar = '_' . $var;
|
|
|
- $headers[ucfirst($var)] = implode(', ', $this->_formatAddress($this->{$classVar}));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
$headers += $this->_headers;
|
|
|
if (!isset($headers['Date'])) {
|
|
|
$headers['Date'] = date(DATE_RFC2822);
|