fix
This commit is contained in:
parent
4ae4ca097a
commit
da4eefdbf6
|
|
@ -447,11 +447,18 @@ class EmailComponent extends Object{
|
|||
function __createHeader() {
|
||||
if ($this->delivery == 'smtp') {
|
||||
// Handle both string and array for TO field
|
||||
error_log("[EmailComponent] Creating TO header. \$this->to = " . print_r($this->to, true));
|
||||
error_log("[EmailComponent] is_array(\$this->to) = " . (is_array($this->to) ? 'true' : 'false'));
|
||||
if (is_array($this->to)) {
|
||||
$this->__header[] = 'To: ' . implode(', ', array_map(array($this, '__formatAddress'), $this->to));
|
||||
$formatted = implode(', ', array_map(array($this, '__formatAddress'), $this->to));
|
||||
error_log("[EmailComponent] Formatted TO addresses: " . $formatted);
|
||||
$this->__header[] = 'To: ' . $formatted;
|
||||
} else {
|
||||
$this->__header[] = 'To: ' . $this->__formatAddress($this->to);
|
||||
$formatted = $this->__formatAddress($this->to);
|
||||
error_log("[EmailComponent] Formatted TO address (single): " . $formatted);
|
||||
$this->__header[] = 'To: ' . $formatted;
|
||||
}
|
||||
error_log("[EmailComponent] TO header added: " . end($this->__header));
|
||||
}
|
||||
$this->__header[] = 'From: ' . $this->__formatAddress($this->from);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue