I have a Drupal 9.5 test server and a production server. The test server is working fine but the production server suddenly stopped sending emails (new accounts, custom form output, etc.). The settings should be the same on both but I double-checked the Drupal settings to be sure.

The Drupal logs don't say anything more than "error sending email". I tried the system maillog but there was nothing helpful there.

I also have the mimemail module installed. Neither mimemail nor system emails are going out.

Where should I look next to troubleshoot this? Is there a common solution to this problem?


1 Answer 1


If MailInterface::mail returns FALSE ("TRUE if the mail was successfully accepted for delivery, otherwise FALSE"), Error sending email (from %from to %to with reply-to %reply) is logged.

So, if this is PhpMail, which I think is the default MailInterface implementation, then PhpMail called PHP's mail function ("Returns true if the mail was successfully accepted for delivery, false otherwise"). That returned false.

Therefore, probably the email was not accepted for delivery by whatever way PHP is set up on that system to send mail. The answer to your question is: you should next look to why PHP's mail function is returning false.

Additionally some of the answers on https://stackoverflow.com/questions/3186725/how-can-i-get-the-error-message-for-the-mail-function/20203870#20203870 may be useful to you.

  • Thanks, @cilefen. Heading down that path, I see that php.ini uses sendmail. I tried sending an email from command line with sendmail and it worked fine. The maillog says the email was sent but Drupal says there was an error and I never received the email. Where can I look next?
    – Chanel
    Commented Feb 1 at 14:58
  • stackoverflow.com/questions/3186725/…
    – mona lisa
    Commented Feb 1 at 15:23
  • That would be useful if I were writing code but I'm not. I'm trying to figure out what changed in a system that functioned fine for months.
    – Chanel
    Commented Feb 1 at 20:04
  • It seems you may have to write some code, in a test program that could help you drill-down to the interface between PHP and sendmail. I can see no other way. Anyway, as Drupal Answers isn't a forum I'll leave my answer here, which explains the next troubleshooting step.
    – mona lisa
    Commented Feb 1 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.