I'm getting the following error when I try to send mail with Mass Contact 5.x-2.4-beta on a Drupal 5.2 installation:
cid = "1"
1 errors encountered sending message. Please check the logs and try again.
warning: mail() [function.mail]: SMTP server response: 501 syntax error in C:\websites\www\includes\common.inc on line 1979.
This is the section of code that it points to:
...
return mail(
$to,
mime_header_encode($subject),
str_replace("\r", '', $body),
join("\n", $mimeheaders)
);
...
The comments above this section talk about line-break differences between Windows and Linux servers ("\r\n" as opposed to "\n"), but I do not believe that this part of the code is at fault because the site can send out registration emails just fine. Nonetheless, I have played with the str_replace arguments considerably, but to no avail.
Thanks in advance!
Comments
Comment #1
eromba commentedIt turns out that this issue was due to the format of the "to" header that Mass Contact uses. This module sends emails using the address format "Username " (without the quotes). For example: "John Doe ". However, it appears that Windows servers will only work with the email sent to: "john@~.com" (again, without quotes).
Thus, I had to change the following in mass_contact.module:
~Line 904:
to...
And then around line 973:
to...
I hope this helps others with the same problem!
Comment #2
oadaeh commentedDo you have the SMTP Authentication Support module installed? If so, your error is because of it. I will be working on correcting the bugs in that module very soon.
Comment #3
oadaeh commentedI fixed this and submitted the changes to the head of the 2.x branch yesterday.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
snohio commentedThe SMTP Module does fix this issue as well. Looks like a problem with the way Microsoft IIS/SMTP handles the RCPT TO: address. I posted some information from the logs here: http://drupal.org/node/33967. Simple solution is to install the SMTP module.. Thanks!!