Cannot send email - receiving "error sending email" message indicating that the to email address is not being populated. This error happens when testing the email from the admin configuration settings and anytime a site email is being sent (i.e. contact email).

Sending of at least one e-mail failed. The error returned was:
Invalid address: .
Unable to send e-mail. Please contact the site administrator if the problem persists

It works when I override the settings file with a debug email address as indicated in the documentation so the SMTP settings are correct.

I followed the documentation and installed and enabled the phpmailer module and copied the two phpmailer classes to the phpmailer/phpmailer folder (COPY HERE).

Comments

fnikola’s picture

More info regarding versions for the above issue:

Drupal PHPMailer – 6.x-2.x-dev (same error with 6.x-2.1)

PHPMailer – v5.1 (also tried with v2.2.1 with same error)

PHP – 5.2.9

fnikola’s picture

Looking at this again and used the 6.x-2.1 version with the recommended version of PHPMailer Library (class.phpmailer.php and class.smtp.php) of 5.0.2 with the same result - the "to" address is not being populated in the emails.

phpmailer - You must provide at least one recipient email address.
mail - Error sending e-mail (from xxx@xxx.com to ).

Please note the to address is blank in the log - for some reason it is not being populated.

However, when I reroute the emails for debugging in settings.php ($conf['phpmailer_debug_email'] = 'your_debug_email@yoursite.com';) it works. This is because the code first checks for the override and uses it if it exists. Trying to determine why the to email address is not populated.

smk-ka’s picture

Status: Active » Postponed (maintainer needs more info)

That's strange, it sounds a bit like some of the other bug reports which are saying the settings are not saved. I can think of two possible explanations: either the entered value is lost somewhere in the middle between submitting the settings and redisplaying it (which is the point when the email is actually sent), or the email address extraction part doesn't work. Does your test address contain special characters or the like? You could also try to dump the recipient email to the screen by temporarily changing phpmailer.drupal.inc around line 34:

    if (variable_get('phpmailer_debug_email', '') === '') {
      /* DEBUG START */
      var_dump($message['to'], phpmailer_parse_address($message['to']));
      /* DEBUG END */
      // Set recipients.
      foreach (phpmailer_parse_address($message['to']) as $address) {

Maybe this gets us a little closer to what's going on here.

smk-ka’s picture

Any news on this issue?

Roze-1’s picture

Subscribe

jham’s picture

Subscribe

guntherdevisch’s picture

Version: 6.x-2.x-dev » 6.x-3.0

Hi,

I'm also getting the error:

Invalid address: You must provide at least one recipient email address.

Strange cause i didn't update the following modules:

PHPMailer (having version 6.x-3.0)
SMTP Authentication Support (having version 6.x-1.0-beta5)

I did recently update the drupal core to drupal-6.20 and installed some other modules.

Any ideas?

Thanks in advance,
Gunther

oadaeh’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (won't fix)

This issue is being closed due to Drupal 6 being at the end of its life. If you feel this is still a valid issue for the Drupal 7 compatible branch of this module, feel free to re-open this issue and provide updated information.