using version smtp.module,v 1.7.2.2 2007/01/17 15:52:13 lukelast

both my webforms and my sitewide contact form fail when sending to multiple comma-separated recipients, and they show the following error in watchdog:

Error sending email: SMTP Error: The following recipients failed: address1@domain.com, address2@domain.com From: address3@domain.com To: address1@domain.com, address2@domain.com

(I tried spaces and semi-colons, too, although contactform suggest commas and webform doesn't say.)

Both modules work when the smtp.module is not installed.

Our particular mail system/server set up will only let us send within our own domain, so I need the smtp so that users who fill out the contact form from outside can receive a copy and so we can, down the road, allow subscription/mail etc. for users outside of the domain.

I did look for existing docs, issues, etc. Please forgive me if I missed them (and point me in the right direction), and thank you in advance for any help you can provide.

Comments

zetxek’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Priority: Normal » Critical

I suppose the bug is the same in the 5.X version, as I have tested and I'm having the same problem.

Is the project dead? If so, anyone knows any option? (I need to send emails trough SMTP).

zetxek’s picture

Title: fails sending to multiple recipients » possible fix: fails sending to multiple recipients
Assigned: Unassigned » zetxek
Status: Active » Needs review

I think this can be fixed by replacing around line 219

		$mail->AddAddress($to);

with this code:

	if (is_array($to))
		foreach($to as $singlemail){
		$mail->AddAddress($singlemail);}
	else
		$mail->AddAddress($to);

Now my drupal is able to send multiple mails without problems, but this fix should be confirmed in other environments.

oadaeh’s picture

Status: Needs review » Active

Code in the comment does not qualify as a patch. See http://drupal.org/patch for more information.

Edit: I should mention that I will be working on correcting this, so sending a patch is not necessary.

zetxek’s picture

Sorry for that false patch, I should have not marked as it, as I only meant to provide some kind of workaround.

oadaeh’s picture

Status: Active » Fixed

The fix for the multiple recipients problem has been committed here: http://drupal.org/cvs?commit=90656

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.