We have a site that sends lots of emails to extensive address lists. In order to not expose those lists to everyone, we merge To and Cc into the Bcc list and empty those fields. This is still a valid email.

Unfortunately, SMTP seems to think an empty To field is invalid and throws the email away. This is horribly wrong.

Comments

NancyDru created an issue.

neorush’s picture

I'm having the same issue where _get_components() returns a blank address for a comma separated list of addresses. The log just has "smtp Invalid address: " (and the whole email is dropped). I found the previous bug submissions where this would occur when an email list had a space in it, and there are trims now in the _get_components() function so it's odd it still returns one. The fix I came up with was to add a trim() before it is sent to _get_components()
On line 176 of smtp.mail.inc

176: $to_comp = $this->_get_components($torecipient);
Changed to: $to_comp = $this->_get_components(trim($torecipient));

Fixes the issue.