How To Use Google's SMTP Server | DigitalOcean
Có thể bạn quan tâm
- Blog
- Docs
- Get Support
- Contact Sales
- Tutorials
- Questions
- Product Docs
- Cloud Chats
- Search Community
Report this
What is the reason for this report?This undefined is spamThis undefined is offensiveThis undefined is off-topicThis undefined is otherSubmitTable of contents
- Benefits
- Settings
- Sending Limits
- Conclusion
- Tutorials
- How To Use Google's SMTP Server
By Pablo Carranza, Mateusz Papiernik and Matt Abrams
LanguageEnglishThe 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.
- SMTP server (i.e., outgoing mail server): [smtp.gmail.com (http://smtp.gmail.com)
- SMTP username: Your full Gmail or G Suite email address (e.g., [email protected] or example@your_domain)
- SMTP password: Your Gmail or G Suite email password
- SMTP port: 465
- 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)
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.
See author profileSupporting 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.
See author profileCategory:TutorialTags:EmailStill looking for an answer?
Ask a questionSearch for more helpWas this helpful?YesNoComments(10)Follow-up questions(0)This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sign in/up to commentCould indicate managers emails to use with Droplets. I know: AfterLogic webmail Roundcube. Does anyone know more?
Reply@Rodrigo: I’m not sure I understand what you mean. Are you talking about webmail clients?
ReplyDo you know if the 99 mails limit is also applicable to google apps accounts? There is some alternative DO smtp service to the google one?
Reply@igonzalezvaliente: Take a look at this: http://support.google.com/a/bin/answer.py?hl=en&answer=166852 I personally use Mandrill for sending email, but there are other alternatives such as SendGrid, Postmark, etc.
ReplyThanks for the tip @Pablo Carranza: I also use SMTP2GO.com when I’m travelling, you can send more than 99 emails per day if required.
Replyi found your article searching for ways to fix a gmail 535 error (i have a hotmail email accc) and was looking at alternative fixes (because msft help is useless)…I was hoping your workaround (change default email) would help, but aas not. Outside of using services like smpt2go, any ideas on how to get around the gmail login failure? thanks
Reply@Kamal: You said that you use Mandrill for sending emails, and I am thinking of doing that, but is there a way of setting roundcube webmail for doing so, or I can use Mandrill just for desktop program configuration? Here is a picture of what I am doing: I have a droplet with zpanel installed, therefore it has roundcube, and it is receiving and sending emails, but I wasnt able to create/set a DKIM or Domain Keys, in order to sign my emails, I could do the SPF correctly, but some emails still go to the spam box when I send… Thats why I want to use Mandrill. Can you help me?
ReplyKamal Nasser
Thanks for most useful post. works perfectly for me. working about it too long to find any normal SMTP server and its for free really great. and traffic i use is much less then it gives for free. THANKS!
Replyfelipe.campos
I use Kerio Connect as mailserver and it has a function of SMTP delivery where you can use another server for SMTP it also works in webmail mode because kerio connect is also a web server, its very simple and easy to use and also has all functions that most users need.
Reply@KamalNasser - Do you use Mandrill for ALL outgoing email or just certain emails? Using it for all your outgoing email is interesting…g
ReplyLoad more comments
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.Deploy on DigitalOcean
Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.Sign upPopular Topics
- AI/ML
- Ubuntu
- Linux Basics
- JavaScript
- Python
- MySQL
- Docker
- Kubernetes
- All tutorials
- Talk to an expert
Featured tutorials
- SOLID Design Principles Explained: Building Better Software Architecture
- How To Remove Docker Images, Containers, and Volumes
- How to Create a MySQL User and Grant Privileges (Step-by-Step)
- All tutorials
- All topic tags
Join the Tech Talk
Success! Thank you! Please check your email for further details.Please complete your information!
Become a contributor for community
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Sign Up
DigitalOcean Documentation
Full documentation for every DigitalOcean product.
Learn more
Resources for startups and AI-native businesses
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Learn more
Get our newsletter
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
SubmitSubmitNew accounts only. By submitting your email you agree to our Privacy Policy
The developer cloud
Scale up as you grow — whether you're running one virtual machine or ten thousand.
View all productsGet started for free
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
Get started*This promotional offer applies to new accounts only.
© 2026 DigitalOcean, LLC.Sitemap.