When you are using the SMTP Authentication Support module, email is sent directly from the your drupal application through the mail server that you specify in the module configuration.
Sometimes it can be a bit difficult to understand why email that you expect to see from your site hasn't been delivered.
The process of troubleshooting this type of problem is pretty straightforward.
- First, log into your site, and go to the settings page at http://yoursitename.com/admin/config/system/smtp
- Then, enable Debugging (using the checkbox toward the bottom of the setting pages). This will enable logging with 'smtp' in the drupal-watchdog.log for every email that is sent from the site.
- Use the Send a Test E-Mail feature to send yourself a test email. If you don't get the email, don't worry. We are using this to look through the logs in the next step.
- Use SSH to connect to your sever, and cd to switch to the directory with your log files, usually this is
- Use grep to look through your drupal-watchdog.log and find SMTP logs with the following search:
You will likely get a result that looks a lot like:
grep smtp drupal-watchdog.log
drupal-watchdog.log:Sep 26 17:29:52 172.16.2.133 ohio: https://yoursitename.com|1537982992|smtp|188.8.131.52|https://yoursitename.com/admin/config/system/smtp|https://yoursitename.com/admin/config/system/smtp|1||Sending mail to: email@example.com request_id="v-c6b6b524-c1b1-11e8-b5cc-abe438f9b08b"
- You may get a large number of results, if you do not to worry, just scroll to the end, and use a grep by the request_id to pull up all of the logs related to a particular smtp request.
You will get all of the related transactions for that particular request. If you get lucky, the email error will be pretty straightforward like this one:
grep request_id="v-c6b6b524-c1b1-11e8-b5cc-abe438f9b08b" *.log
This error was resolved by contacting the email provider and renewing the license.
drupal-watchdog.log:Sep 26 17:29:53 172.16.2.133 ohio: https://yoursitename.com|1537982993|smtp|184.108.40.206|https://yoursitename.com/admin/config/system/smtp|https://yoursitename.com/admin/config/system/smtp|1||Error sending e-mail from firstname.lastname@example.org to email@example.com: SMTP Error: Data not accepted.SMTP server error: 5.2.0 STOREDRV.Submission.Exception:InvalidLicenseException; Failed to process message due to a permanent exception with message Mailbox 'df962302-379c-4290-9c1a-df8b74d200fa' doesn't have a valid license. InvalidLicenseException: Mailbox 'df962302-379c-4290-9c1a-df8b74d200fa' doesn't have a valid license. request_id="v-c6b6b524-c1b1-11e8-b5cc-abe438f9b08b"