Report this

What is the reason for this report?

How To Use Google's SMTP Server

Updated on October 6, 2020
Pablo CarranzaMateusz PapiernikMatt Abrams

By Pablo Carranza, Mateusz Papiernik and Matt Abrams

English
How To Use Google's SMTP Server

The author selected the COVID-19 Relief Fund to receive a donation as part of the Write for DOnations program.

Introduction

A little-known feature of Gmail and Google Apps email is Google’s portable SMTP server. Instead of having to manage your own outgoing mail server on your DigitalOcean Droplet or Kubernetes Cluster, you can configure Google’s SMTP server settings with whatever script or program you wish to send email. All you need is either (i) a free Gmail account, or (ii) a paid G Suite account.

Note: As of June 22, 2022, DigitalOcean is blocking SMTP for all new accounts. As a part of this new policy, we have partnered with SendGrid so our customers can still send emails with ease. You can learn more about this partnership and get started using SendGrid by checking out our DigitalOcean’s SendGrid Marketplace App.

Benefits

You have the option of having Google store and index the emails you send via its SMTP server, so all your sent emails will be searchable and backed-up on Google’s servers. If you elect to use your Gmail or G Suite account for your incoming email as well, you’ll have all your email in one convenient place. Also, since Google’s SMTP server does not use port 25, you`ll reduce the probability that an ISP might block your email or flag it as spam.

Settings

Google’s SMTP server requires authentication, so here’s how to set it up in your mail client or application:

Note: Before you begin, consider investigating your mail client or application’s security rating, according to Google. 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) or generate an application-specific App Password. For more security information, see this link to determine the best approach for your mail client or application.

  1. SMTP server (i.e., outgoing mail server): [smtp.gmail.com (http://smtp.gmail.com)
  2. SMTP username: Your full Gmail or G Suite email address (e.g., example@gmail.com or example@your_domain)
  3. SMTP password: Your Gmail or G Suite email password
  4. SMTP port: 465
  5. SMTP TLS/SSL required: yes

In order for Google to automatically copy your sent emails to the sent folder, you must also verify that IMAP access is enabled for your account.

To do so, go to the Gmail settings and click on the Forwarding and POP/IMAP tab. Scroll down to the IMAP Access section and make sure that IMAP access is enabled for your account.

Note: Google will automatically rewrite the From line of any email you send via its SMTP server to the default email address associated with the account if the one used is not on the Send mail as addresses list in Gmail or G Suite settings. You can verify the list by going to the Accounts and Import tab on the settings screen.

You need to be aware of this nuance because it affects the presentation of your email, from the point of view of the recipient, and it may also affect the Reply To setting of some programs.

Sending Limits

Google limits the amount of mail a user can send through its portable SMTP server. This limit restricts the number of messages sent per day to 99 emails; the restriction is automatically removed 24 hours after you hit the limit.

Conclusion

You now have the option of using Google’s SMTP Server. If this lightweight option is not sufficient, you can consider installing and configuring postfix as a send-only SMTP server.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Pablo Carranza
Pablo Carranza
Author
Mateusz Papiernik
Mateusz Papiernik
Author
Software Engineer, CTO @Makimo
See author profile

Creating bespoke software ◦ CTO & co-founder at Makimo. I'm a software enginner & a geek. I like making impossible things possible. And I need tea.

Matt Abrams
Matt Abrams
Editor
See author profile

Supporting the open-source community one tutorial at a time. Former Technical Editor at DigitalOcean. Expertise in topics including Ubuntu 22.04, Ubuntu 20.04, CentOS, and more.

Category:
Tags:

Still looking for an answer?

Was this helpful?
Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.