My drupal site isn't sending email for some reason. What are some ways to debug this issue of mail sending?
-
Have you checked admin/reports/dblog? You can use the core contact module to send an email and check what comes up in the logs. The SMTP module will send email for you regardless of your server configuration. I used it while debugging my mail sending issue some time ago.– gbyteCommented Aug 11, 2015 at 17:15
3 Answers
The Mail Logger module will tell you if the mail is being sent by Drupal and in fact is a useful module for keeping track of outgoing e-mail.
Use a module that allows you to route email through a real SMTP server.
What is probably happening is that Drupal is sending the mail, but it's being blocked as a spammy looking email message.
edit: you can Alphabet for "drupal smtp module", but this is one I've used https://www.drupal.org/project/smtp
-
-
I have installed smtp module from day 1 in my d7, and its able to send Test email, working even today . But emails which am trying to send through my custom modules suddenly stopped working and not sending emails at all. No SMTP errors logged....What could be the problem...any guess? Commented Mar 16, 2018 at 9:09
If you are not getting any email from any contact forms on the site or even registration emails. You might want to goto the server terminal and try to see if it has anything to do with your mail server. You can run the following command:
drush php-eval "print mail('[email protected]','Test subject from drush','Test message','From: [email protected]');"
Just replace the emails with your own. If you still aren't receiving anything you can check the maillogs located here: /var/log/maillog
Then search for the email address you are sending to. If its working it should look something like this:
Aug 11 10:31:56 YRELX05 postfix/smtp[18534]: 6222BB1: to=, relay=172.22..[172.22..]:25, delay=0.02, delays=0.02/0/0/0 , dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> Queued mail for delivery)