Download & Extend

Multiple recipients using SMTP Authentication Support

Project:SMTP Authentication Support
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Issue tags:multiple recipient, SMTP Authentication

Issue Summary

If you create a contact form category that specifies a comma-separated list of two or more recipients then the site-wide contact form email will not be sent and an error message will be generated instead stating that the sending email address is invalid. The error message incorrectly gives a sending email address which is actually the comma-separated list of recipients.
By replacing the list of recipients with a single recipient, the error is avoided .... except you've lost your multiple recipients of course!
It would appear that this error is caused by the site-wide contact module not forming a transport-independent argument or the SMTP Authentication Support not requiring a transport-independent argument.

Comments

#1

Priority:normal» critical
Assigned to:Anonymous» markwhistler

I'm not sure if I'm posting this in the right place... But if anyone could help I would be really, really grateful... I've installed the SMTP Authentication Support module, along with the PHPMailer... My test emails work perfectly from both the SMTP Authentication Support and PHPMailer Admin pages... However, mail fails from both the contact form and the request new password email request.

I've tried most of the patches on the site, and yet, I cannot get mail (beyond the simple test emails) to go through...

Thank you so much for your help!

#2

markwhistler, if this issue is assigned to you, it means that you will work alone on the solution.

#3

Project:Drupal core» SMTP Authentication Support
Version:6.14» 6.x-1.0-beta4
Component:contact.module» Code

If it's failing from both user e-mails and contact e-mails, it's obviously a bug in either SMTP Authentication or PHPMailer not handling a mutli-email 'To' value.

#4

same issue, just subscribing

#5

Assigned to:markwhistler» Anonymous

same issue, just subscribing

#6

Status:active» postponed (maintainer needs more info)

Please, which are the versions of Drupal, SMTP and PHPMailer that you're using?

#7

Drupal: 6.15
SMTP: 6.x-1.0-beta4
PHPMailer: 5.1

#8

Currently we do not support PHPMailer with versions >= 2.3 . We have patches working for 2.2.1, and we still have to port the module for higher versions.

Please, try with PHPMailer 2.2.1

#9

ok ive tried it now with phpmailer 2.2.1 and kinda works now, it sends the emails and both recipents get it but it still displays this:

    * The submitted from address (1stmail@1stmail.com,2ndmail@2ndmail.com) is not valid.
    * Unable to send e-mail. Please contact the site administrator if the problem persists.

Your message has been sent.

Thanks for Helping!

#10

Why is he complaining about the "From" address?

#11

because it has a comma on it, once i change it back to a single address the error disappears, it sends it but keeps displaying that error.

im not a coder so i dont really know whats happening, but the error comes from smtp.module line 327 so maybe it can be disabled?

Thanks!

#12

The point is, are you trying to send the email FROM 2 addresses?
The message complains about a multiple "From" address, and that's a valid complaint, if it is right.

#13

Funny, i have read that sentence millions of times but never really noticed that it says FROM not TO. anyway i think its wrong because when you add a contact form category it asks for RECIPIENTS:

Recipients: *
mail1@mail1.com,mail2@mail2.cl
Example: 'webmaster@example.com' or 'sales@example.com,support@example.com'. To specify multiple recipients, separate each e-mail address with a comma.

Im not trying to send an email FROM 2 addresses, you cant set two addresses at the SMTP configuration page because it wont let you and would complain saying The provided from e-mail address is not valid.

im trying to send and email FROM a single address TO two email addresses

Thanks again!

#14

Status:postponed (maintainer needs more info)» active

Yes, I see, but this could be the source of the problem. It is possible that the code in some point is confusing things and mistaking the recipients for the sender.

#15

I have the same issue. subscribing...

#16

subscribe

#17

Subscribing...

#18

Version:6.x-1.0-beta4» 6.x-1.x-dev

I'm having exactly the same problem. Perhaps I could describe the problem better and hope someone will respond.

My current installation:
Wamp 2 Server on windows installation,
Drupal 6.16 - Latest on drupal site at this time.

Topic1:
What I try to do is send a message using the contact form from my admin user to two or more recipients:
This is a new installation and I'm also new to Drupal.
1. I created two different users (user1@example.co.za, user2@example.co.za) and have the admin user (admin@example.co.za).
2. I enabled the contact form module.
3. Added a category (website information) and included two recipients: text in box "user1@example.co.za,user2@example.co.za" without the inverted commas - and saved it.
4. I added a primary link on the page called "Contact us" (when clicked on it, it takes me to the contact us page.
5. Automatically my admin name is in and my email address. I type a subject, select the website information category, type my message and press "send email"

This message comes up in a red box:
" * warning: mail() [function.mail]: SMTP server response: 501 5.1.7 Bad sender address syntax in C:\wamp\www\includes\mail.inc on line 193.
* Unable to send e-mail. Please contact the site administrator if the problem persists. "

On the report logs the error is described as:
"Error sending e-mail (from user1@example.co.za,user2@example.co.za to admin@example.co.za)."

This report tells me that it is trying to send email from the 2 recipients to my admin user.

The email does in fact send to user1 and user2 but why does it come up with this error message?

If I remove the one recipient in other words send an email using the contact form from my admin account to user1, then user1 gets the email and there is no error message.

The contact form is part of Drupal's core installation so surely this was tried and tested, but it doesn't work for me. any help on topic 1?

Topic 2:
If I replace the recipients with a gmail account ex. user@gmail.com and send using the contact form to that recipient I get the following message:

"warning: mail() [function.mail]: SMTP server response: 554 5.7.1 : Sender address rejected: Access denied in C:\wamp\www\includes\mail.inc on line 193.
Unable to send e-mail. Please contact the site administrator if the problem persists.
"
The report log shows:
"Error sending e-mail (from user@gmail.com to admin@example.co.za)."

any help on topic 2 please?

I think topic 1 and topic 2 comes down to the same problem. Instead from sending mail from admin to users, the contact form module turns it around and tries to send mail from users to admin. The mail does get delivered, but why the error message?

any clever developers out there?

Thanks ya all.

Mseraphim

#19

I managed to kludge a quick fix for this problem.

I created a email forward "feedback@domain.org" with two recipients, and placed this in the form as one address. It does accept the one address, as has been reported, but uses the email system to forward to multiple recipients! Not how it should work, but is a fix for now.

I am not a maintainer of the modules, just another victim of this bug! ;^)

Feedback welcome! (All puns intended!)

#20

Subscribing.

Seeing this using the core contact form - without the SMTP Authentication support module even installed - if more than one recipient is specified.

#21

I know this isn't a true fix, but you can send multi-recipient forms through Webform - http://drupal.org/project/webform

#22

Same issue. Subscribing.

#23

Another idea (not a true fix but it will work): create an email address that forwards to the emails you want to send the form to. Then add that email instead of the multiples you have.

#24

Issue tags:+multiple recipient

Same issue. Subscribing.

#25

On contact.pages.inc, the contact form sends the mail thus:
drupal_mail('contact', 'page_mail', $contact['recipients'], language_default(), $values, $from);

Then if the "send myself a copy box is checked", it inverts the 'to' and the 'from'
drupal_mail('contact', 'page_autoreply', $from, $language, $values, $contact['recipients']);

Then, if there was more than one recipient, and the send myself a copy is checked, the smtp module receives multiple addresses for the from address, which fails valid_email_address($from).

I suggest that the module truncate everything after and including the first comma before validating the from address

#26

Subscribing.

#27

@youri27, please use the button "Follow" on the top of this thread and don't post "Subscribe" comments.

#28

Thanks all, I stopped using the site contact form and just used webform module.

nobody click here