Tuesday 2 June 2015

Drupal 7 - Unable to send e-mail. Contact the site administrator if the problem persists


In Drupal 7 when you configure a contact form it does not allow you to send mail on external addresses for example if you put email id other than your domain name. It shows a warning message as below

Unable to send e-mail. Contact the site administrator if the problem persists.


Solution of this issue is to configure SMTP settings on your drupal site and that will allow you to send mail.

Listing down the steps that can be used to setting up these. But there is high risk involved for your gmail account. Once you apply these settings you might received mail from google as below

*********************************************************************************

Hi XXXXX,

We recently blocked a sign-in attempt to your Google Account [XXXXX@gmail.com].

Sign-in attempt details
Date & Time: Tuesday, 2 June, 3:07 p.m. GMT
Location: Unknown

If this wasn't you
Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away.

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.

To learn more, see https://support.google.com/accounts/answer/6010255.

Yours sincerely,
The Google Accounts team

*********************************************************************************

When you click on "If this was you" link https://www.google.com/settings/security/lesssecureapps 
It will land you on page with below information


Hence Please be sure if you want to use SMTP configuration with above risk. 


  1. Please download SMTP authentication module from link as mentioned. Please search with "Drupal SMTP" If you don't see on below link. there could be situation that you read this after a long time - https://www.drupal.org/project/smtp
  2. Now please download this module and enable it. Hope I don't need to explain how to enable modules in drupal. After enabling this module go to Admin > Configuration > SMTP authentication support and set the following values:
  3. Turn on the module at the Install options fieldset at the top.
  4. SMTP server settings:
  5. smtp server: smtp.gmail.com - This would be by default
  6. smtp backup server: leave blank.
  7. smtp port: 465 - This would be by default
  8. use encrypted protocol: select "use SSL"
  9. SMTP authentication:
  10. Enter a valid Gmail email address and password. - Please make sure you have understood risk involves before allowing this.
  11. Email options:
  12. Set the same email address that you used at SMTP Authentication.
  13. Send test email: set an email to receive a sample email.
  14. Enable debugging: yes.

Click on submit and verify that the email was submitted and that you received it. You can enable/disable debugging as per your need so if you want to see output you can keep debugging on. Thats all.
Hope this would be quite useful. Please comment if you still face an issue. We would be happy to help you.

Thanks ---- Happy Learning......!!!

No comments:

Post a Comment