How to send emails from my domain from the gmail web client?

Hello! I’m trying to send emails from the gmail web client with as sender.

Currently I have PostFix installed which is forwarding emails send to anything to my gmail inbox. And if I send mail from the command line, they get sent using my gmail account. (And with as sender)

I want the last bit the other way around, I want to add as an alias in gmail so I can select it as sender.

99% of the google hits are to set up postfix to use the gmail smtp server, so I cannot find what I’m looking for.

I’m open to getting rid of my current postfix installation if another program will serve me better.

Submit an answer

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 or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey friend!

As someone who gets a lot of headaches working on mail servers, I want to start by letting you know that the easiest path to this is to sign up for G Suite:

The reason that people are paying money for this isn’t because they don’t know how to set up their own SMTP server. Many of them could, or could pay someone to do it. Email just isn’t as simple as it used to be, and having a working mail server one year might mean that you don’t have a working one next year if you don’t keep up with current trends in managing it. Quite simply, you’re going from letting Google handle the work to running your own mail server, and I don’t want to downplay the headaches that can cause.

That said, there’s no step by step I can give you, but I can give you the high level. This is what you need:

  1. Drop the function that sends all mail from your server through Gmail.
  2. Add SMTP authentication.
  3. Use this guide to set up the SMTP settings in Gmail:
  4. Make sure the server’s hostname is a FQDN, that postfix has that FQDN configured as it’s hostname for the HELO statement, and that the server’s reverse DNS matches that FQDN. This is key for forward confirmed reverse DNS, a basic requirement for any hope at quality delivery.

Hope that helps :)