DEV Community

Cover image for AWS SES + Gmail = Free Business Email ID

AWS SES + Gmail = Free Business Email ID

daltonfury42 on September 12, 2020

My website is hosted on AWS Free Tier, and I wanted to create a free company/business email address for people to contact me. If you are already on...
Collapse
 
thatdevopsguy profile image
Sebastian Weigand

Pro-tip: You can do all of this with built-in functionality with Google Domains, where you can establish mail aliases and forwarding rules from your custom domain. There's no need for extra complication or additional services.

See this article for more information.

Collapse
 
ashleymavericks profile image
Anurag Singh • Edited

Thanks for this info, i was using improvmx till now even though I have a google domain.

Collapse
 
daltonfury42 profile image
daltonfury42

Yep, if your are willing to transfer your domain to Google Domains, this is looking very easy!

Collapse
 
wandetri profile image
wandetri • Edited

Hi Thanks for this trick
Its Working!
but there is a problem, all of my sent email goes to Promotion tab in gMail Inbox

edit
After I modify the email content to longer and more 'personal' instead of 'Test Email', it goes to my main inbox.

Thanks!

Collapse
 
joergrech profile image
Jörg Rech

Hi! Just implemented it for one of my domains and it works really well - thank you! One question though: Do I need to "register" every name of a domain at Gmail or should it work out of the box? For example:

I have the following config in the Lambda code:

  forwardMapping: {
    "@<MY_DOMAIN>.com": [
      "<ME>@gmail.com"
    ]
  }
Enter fullscreen mode Exit fullscreen mode

However, only @.com is forwarded to Gmail (where I added this email address) but emails to info@.com is only stored in S3 but not forwarded.

Collapse
 
chris_hayes profile image
Chris Hayes

For what it's worth - I haven't had that issue, it works as wildcard for me with all the email addresses I don't specifically mention.

Collapse
 
unfor19 profile image
Meir Gabay

An honest question - is this better than using Google's MX records in Route53? I'm trying to understand the benefits of this method

Ref - support.google.com/a/answer/614969...

Collapse
 
daltonfury42 profile image
daltonfury42 • Edited

I've not gotten chance to play with GSuite / GApps for business much, but I am guessing this works only when you have a paid GSuite Account?

This solution is when you have a free personal Google account. Please correct me if I am wrong, though.

Collapse
 
unfor19 profile image
Meir Gabay • Edited

I think you are right, my assumption was that you have a GSuite account since you talked about a "company/business email address". I don't think it's possible to use MX records with a personal account, thanks for the clarification

Thread Thread
 
daltonfury42 profile image
daltonfury42

Hey. Thanks for pointing this out.. I'll edit the post to make this clear.

Collapse
 
andrewrooke profile image
andrewrooke

While this may be a good way to get started quickly, have you thought through the implications for SPF and DMARC ?

Every time i create a business domain and email service, I ensure I configure SPF and DMARC (and ideally DKIM) to secure my email service.

Collapse
 
shreyashg profile image
Shreyash Gupta

Hi,

I am the Co-founder of Looseleaf which is a startup in the education sector of India. We currently want to get our domain emails using the AWS SES. I would like to ask if you would be interested in helping us out as it seems that you know what you are doing. Let's discuss further details below!
Contact Email: officiallooseleaf@gmail.com
Our website: looseleaf.in

Collapse
 
daltonfury42 profile image
daltonfury42

Hi Shreyash,

I'd be happy to help. Let's connect this weekend.

Collapse
 
shreyashg profile image
Shreyash Gupta

Just send me an email with your times that you can hop on a google meets call this weekend and then we will go on from there!

Collapse
 
aftabnaveed profile image
Aftab Naveed

I just tried configuring it on my GMAIL account, I was able to make the AWS SES part working and can see emails arriving to my S3 bucket, however when I try to connect my Gmails' "Send mail as " I get this error

Authentication failed. Please check your username/password.
Server returned error: "DNS Error: DNS type 'aaaa' lookup of smtp.email-smtp.us-east-1.amazonaws.com responded with code NXDOMAIN DNS type 'a' lookup of smtp.email-smtp.us-east-1.amazonaws.com responded with code NXDOMAIN, code: 553"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ankushjain profile image
Ankush Jain • Edited

Created a video tutorial on the same topic inspired by this blog.

Creating Business Emails using Amazon SES | Sending & Receiving Emails with Amazon SES

youtube.com/watch?v=LhkXP9Oli7U

Collapse
 
lewiscowles1986 profile image
Lewis Cowles

I sort of love you for this, but you can setup any email host just using route53 and likely own less of a footprint, and escape gmail

Collapse
 
daltonfury42 profile image
daltonfury42

Hey. I want to give this a try, can you give me a rough idea. Can I do this using my personal gmail account? Otherwise which mailbox providers allow this?

Collapse
 
lewiscowles1986 profile image
Lewis Cowles

Sure, so I don't know how much you understand DNS, but the way I use a shared host to do this is to tell them I'm hosting a domain with them. I don't change the nameservers, because I love AWS and am cheap.

I can then go into their DNS settings, take out the MX records and place them into my AWS.

You can use AWS UI to do this, or Terraform, or any other IaC tooling that integrates with your cloud provider (doesn't have to be AWS, can be Azure, GCP or DigitalOcean AFAIK)

There are some gotchas. I don't think Heroku supports, but you can have heroku only own a CNAME.
Also you should not move other subdomains like webmail to your domain. Let the shared host do that with SSL and all the bells and whistles to secure your email from attackers. You can also front that with SES and forwarding rules, although I was gutted to see that.

Collapse
 
ypk profile image
ypk

Your S3bucket Permissions throws an error: "Missing required field Principal"

Collapse
 
daltonfury42 profile image
daltonfury42

Hi,

Can you add SES as a principal to your bucket's policy? In my case, since I created the bucket from within SES, the policy was set for me.

stackoverflow.com/questions/418192...

Collapse
 
ypk profile image
ypk

I've followed other tutorial linked in one of the replies. Yes you can add principal as it did allow me to.

I'll be honest, this instructions are not walk in the park, I was expecting a push button solution.

Collapse
 
daltonfury42 profile image
daltonfury42

Another similar article, in case you got stuck: infra.engineer/aws/11-using-gmail-...

Collapse
 
_omnaidu_ profile image
Om • Edited

Is this for free plan on AWS, will i not be charged for sending emails from outside AWS with Gmail client

Collapse
 
audioscavenger_14 profile image
Eric

Excellent! except the missing bucket creation+permission part as described on stackoverflow, thank you

Collapse
 
chrisshort profile image
Chris Short

Is this working again?

Was broken for a bit.

Collapse
 
daltonfury42 profile image
daltonfury42

I was able to set it up yesterday. So is working, I guess

Collapse
 
aznable_char profile image
Victor

We don't need to create a MX record?

Collapse
 
daltonfury42 profile image
daltonfury42

Yes, you need to if you want to receive emails. This is covered in the Setup SES section

Collapse
 
sowmenappd profile image
Sowmen Rahman

Also, for people who’re setting up their hosted zone for the first time may not be aware of the 1$ charge, so look out for that guys!