Hi,

I'm not able to send mail at all using this module - I continually receive the error message:
"1 error messages received. Please check the logs and try again"

In the logs I get this error message:
"mail(): SMTP server response: 501 5.5.4 Invalid Address in E:\***\***\***\includes\common.inc on line 1970." (directory references removed for privacy) Line 1970 shows a closing bracket as far as I can tell.

I'm running Drupal 5.1 with MySQL 4.0.17 and PHP 4.3.4 on IIS. I've tried sending it to just one user (via a role assignment), sending it to all users, sending just using the defaults, sending using options and I get the same error message every time.

Thanks in advance for your assistance.

Comments

oadaeh’s picture

Component: Code » Miscellaneous

Line 1970 is the final line for the function call that actually does the sending of the message in Drupal core, and that error is PHP's interpretation of an error message received from the mail server. Check to make sure that all e-mail addresses are complete, accurate and valid, especially the from address. The mail server will fail with an address like joe@example.com because it's invalid, even though it's complete. You might be able to get the address it's failing on from the mail server's log files.

pnc999’s picture

Hi oadaeh,

Thank you for your quick response. I've confirmed that all addresses (both To and From) are valid addresses but am still experiencing problems. I'll keep on with testing (I guess a clean install would be the best way to check what might be happening) as I am keen to use this module and let you know how I go.

josvl’s picture

Hi,
This problem could be caused by your Windows mailer. It may not understand the email address in the format 'name '.
I encountered the same problem and as I didn't find any option in Mass Contact to specify how the addresses are formated, I changed the source of mass_contact.module to my needs.
This is not a good solution, but it works for me in this particular installation:
/* See lines 805 and 865
* replace: $recipientout[] = $rnamea ." <". $rmaila .">";
* with: $recipientout[] = $rmaila;
* to avoid invalid email addresses perceived by some mailers.
* Do the same for $recipient_temp[] around line 805.
*/

Jos

oadaeh’s picture

Title: Unable to send mail - error message received » Unable to send mail on Windows - error message received
Component: Miscellaneous » Code
Assigned: Unassigned » oadaeh
Category: support » bug

I did that for the SMTP module, since it was doing the same thing (adding an extra '<' and invalidating the address). I could just make that part permanent and send all mail to '$rmaila' and not '$rnamea ." <". $rmaila .">"'. The other option is that I need to check for the OS each time I'm formatting the recipient list. I then might run into another situation down the road where this doesn't work correctly. I think it would just be easier to always send to '$rmaila'. :^)

Thank you for your valuable feedback, josvl.

josvl’s picture

Following up on this: even if you send only to $rmaila, admins might install the mimemail module on a Windows server, which then happily looks up the $rmaila in Drupal's {user} table and re-inserts the name and the brackets in the format that the Windows mailer subsequently does not understand.

See mimemail.inc, function mimemail_address

But that is really another issue to another module. ;-)

pnc999’s picture

Josvl,

Your suggestion worked perfectly. Thank you!

lias’s picture

I'm using mass-contact module 5.x-2.4-beta / drupal 5.5 on windows 2003 with apache 2.0

I changed lines 905 and 906 as suggested above to this:

$recipientout[] = $rmaila;
$recipient_temp[] = $rmaila;

and changed line 975 to this:

$recipientout[] = $rmaila;

But still not sending message and I'm still getting the error:

mail() [function.mail]: SMTP server response: 550 5.1.1 User unknown in D:\www\public_html\class\includes\common.inc on line 1986.

EDITED: Started over changing code in mass_contact and now it works with suggested code changes. Thank you.

oadaeh’s picture

Status: Active » Fixed

Okay, I've committed this change to the head of the 2.x branch. I'll cut a new release as soon as I fix a couple of other bugs. Sorry it took so long.

lias’s picture

You mean you have a life?

: ) Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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