I have Drupal Open Social distribution running in Compute Engine on Google Cloud. Compute Engine is essencially a virtual machine, very similar to Amazon EC2.

I have installed the SMTP Authentication module, and am using a google email address to send email, but none of the test emails are working.

Here are the configuration choices for the SMTP Authentication Module:
Turn this module on or off: on
SMTP server: smtp.gmail.com
SMTP port: 465
Use encrypted protocol: Use SSL
Username: The Gmail address
Password: The Gmail password
E-mail from address: The Gmail address
E-mail from name: Default value
E-mail address to send a test e-mail to: Second Gmail address

When clicking Save configuration to send the email, Drupal returns the following error message: Unable to send email. Contact the site administrator if the problem persists.

How can virtual machine and Drupal be configured to send email?

  • 1
    I believe the E-mail from address needs to be from your domain name and not Gmail. Ex: [email protected] the same domain you have set in /admin/config/system/site-information
    – No Sssweat
    Commented Oct 27, 2018 at 6:44
  • 1
    Using an individual GMail account as web email relay is going to be problematic ; it's likely to be flagged as spamming (since a human user won't be using the account). Use an email service provider (e.g. SendGrid, Mailgun, etc.) that will provide you a SMTP configuration that you can use for your Drupal setup.
    – Shawn Conn
    Commented Oct 27, 2018 at 20:16

1 Answer 1


Google will be blocked your application, check this note:

If you are using a program that Google does not consider secure, your usage will be blocked unless you enable less secure applications (a security setting that Google does not recommend). For more information see this link to determine the best approach for your mail client or application


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