It will reach the recipients. However if you leave the key 'To' in the header blank it will show "undisclosed-recipients" for the reader in their mail client.
PEAR->Mail.php recipients and To Header
Question
If I set the recipients do I also need to set the TO header?
I am setting the To header like this (From an EE template in an EE plugin):
$headers["To"] = $this->EE->TMPL->fetch_param('send_to');
and then the recipient like this:
$recipients = $this->EE->TMPL->fetch_param('send_to');
Then sending like this:
$mail_object =& Mail::factory("smtp", $smtpinfo);
$mail_result = $mail_object->send($recipients, $headers, $email_msg);
Do I really need to do both of them?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow