I'm receiving the "Unable to send e-mail. Contact the site admin, if the problem persists." error even though the e-mail sends without a problem.

The watchdog gives this somewhat useless report:
Error sending e-mail (from info@****.org to ).

I found a similar issue here: http://drupal.org/node/359029 but in this case the e-mail wasn't sending. Is there anyway I can just disable the error message?

Comments

Boffy31’s picture

Status: Active » Fixed

I've fixed the problem though rather crudely. Basically I've disabled the error message. Not ideal but it works. To do that just comment out line 135 of mail.inc:

drupal_set_message(t('Unable to send e-mail. Please contact the site admin, if the problem persists.'), 'error');

Status: Fixed » Closed (fixed)

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

aharown07’s picture

Status: Closed (fixed) » Active

I'm having this problem as well and I'd rather not hack the core. Anybody got any more info on it? The emails are going out just fine (and the addresses are valid).
This happens currently on new account registration.

aharown07’s picture

Status: Active » Closed (fixed)

In my case, this turned out to be a config. problem in User Registration Notification module (http://drupal.org/project/user_register_notify) where I had a role defined to receive email notif. but nobody in that role.
The registration email was going out OK to the new account, but the error msg was referring to the role notification email not going out.

Tamil-2’s picture

For me the mails are also not going ..

Tamil-2’s picture

For me the mails are also not going .. anybody find th esolution for this

kjv1611’s picture

Sounds like what could be done to fix the situation (I'm guessing here based on what Boffy31 said) is to add an additional condition regarding "not a registered user", and give a totally different error message for that, possibly with a link directing to the drupal site giving more detail on the problem, and how to fix it.

Unfortunately, I don't know any REAL php, so I wouldn't be able to take a stab at it just now. Hopefully the guess at a solution could at least give somebody else a light bulb moment on fixing it. ;0)

aharown07’s picture

@sweetselvi ...Actually, I think this issue was about the message appearing but when emails were going out. In any case, what you might want to do is see if you have any invalid email addresses for any of your outgoing messages, or if you have messages going to a role that has nobody in it w/a valid email address.
I think the error pretty much appears whenever there's a missing or invalid email address (but it still sends if there any valid ones also).

Lanae’s picture

Version: 6.9 » 6.15
Status: Closed (fixed) » Active

I just started getting this error throughout Drupal, though the emails are still being sent. I haven't installed any modules or changed anything in Drupal since before it started, so I am thinking it is something my shared host changed in php or the server. I doubt they will be able to help though, since the problem is only in Drupal. My error_logs don't show anything unusual, nor does phpinfo. Non-Drupal php code I wrote is still sending email just fine too.

I'm not using User Registration Notify, so that isn't my problem.

The SMTP Support module for D6 is beta and looks like there are many bugs and incompatibilities with other modules I use, or I would try that as a solution.

Any ideas, before I have to go and hack core? :o(

Lanae’s picture

Well I found something that has changed since I started getting the error, but I can't do anything about it so I'll still have to hack core.

I compared email headers from before and after the error, and it looks like my University changed the Return-path from the address of the local Unix user on the web server, to their generic postmaster address, which doesn't have an account on the web server, so this line in the header:

Received: (from WEB_USER@localhost)

changed to this:

Received: (from Unknown UID 124392@localhost)

It could be just a coincidence, but maybe the local mail server is now tripping some error-checking code in Drupal, even though the email is still being sent.

acrymble’s picture

I too had this problem. For me the issue was the "Rules" module which I was also using. I had created a "rule" which wasn't properly set up that was meant to notify me whenever a new user account was created. The rule was trying to send an email to a non-existant email address, which caused the error to appear, even though the new account email was being sent correctly.

I fixed the rule and the error went away.

milos.kroulik’s picture

Thanks a million! It was exactly that reason.

Tino’s picture

@aharown07: Glad I found your comment in #4! Same situation here. Module user register notify enabled, but had no more role selected... After enabling a role in user register notify, no more errors.

adanelova’s picture

Thanks for #4
The 'Send to a custom email address' was selected and email address was left blank. However it says 'If you leave this blank, the site email address, info@mysite.com, will be used.' The email address was actually a real info email address of my site. So apparently if you leave it blank, it doesnt use any email address. I wrote it down there and the error dissapeared.

asb’s picture

@adanelova: Where did you find the 'Send to a custom email address' setting?

Or do you mean "E-mail address" at ./admin/store/settings/store/edit?

Thanks!

NROTC_Webmaster’s picture

Version: 6.15 » 6.25
Status: Active » Closed (cannot reproduce)

Is anyone still having this issue with the latest version?

jeffomac’s picture

This just started happening on one of my sites and it was working fine until the shared host upgraded to Centos6.
During the upgrade my mail routing got switched back to Local instead of Remote which it had been set to. And at first I was not getting mails. I switched it back to remote (mx points elsewhere) and then I started receiving emails from the drupal site but I still got the error messages mentioned above.

So to rule things out I just wrote a few lines of code to do a send mail test.
And even outside of drupal I get a "Message delivery failed" but the email still goes through.

So at least in my case I think the issue is something with the server configuration. I just don't know what it might be.

I'm going to try this though... it might be throwing a red flag because the email To and From addresses are not active mailboxes on the server email in cpanel.
I've seen this before where you have to create a mailbox in cpanel for the address you want to show for the From even though mail is handled Externally.
It's odd, I know. But this has been a requirement for me in the past to make email work.
So I'm going to try that and see if it does any good in this case.