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

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
creating a business email ID using Amazon SES hello everyone my name is ankushen and in this video I will show you how you can create a business email ID using Amazon SES this business email ID will be completely free you won't be paying any additional charges to maintain this business email ID okay so let's first understand what is a business email ID so here you can see this is my website codashony.com and if I just refresh it you can see the the domain of my website is coderjony.com and if I say I want to maintain an email ID like this mail at that code or journey.com which is having my domain name in the email address itself so I will call this email ID a business email ID and if someone sends an email on this email ID I will receive the mail and if I want to send someone to an email then I can use this email ID to send that email so this business email ID looks more professional so we are going to learn how we can create this in SES so these are the four steps that we are going to cover in this video first we will see what AWS region support this kind of feature then we will create a verified identity in ACS and in last third last three and fourth segment we will see how we can configure SCS to receive and send email okay so without any further delay let's get started so let's understand what AWS region supports this email receiving feature so I am on this page and I will provide the link of this page in the description below so you can just get onto this page from that link so if I just open this and I will find a link here email receiving supported regions and when I click on this link it is a AWS documentation link that says that only these three regions North Virginia Oregon and Ireland support this email receiving features so in this demo we are going to use North Virginia reason and you should also use uh any of the these three regions okay so that's the first point and we are done with that so now the second point is creating a verified identity in SCS so what I will do I will go here in my AWS console I will just type SCS and we'll click Amazon simple email service and here I will click on verified identities and I will click on create identity I will select domain and I will type the domain that I own which is coderjony.com if you own another domain then you you have to type your domain name then just leave these two Fields as it is then scroll down inside verifying your domain just you know expand this and select easy dkm select rsa2048 and scroll down and just create identity so what it will do it will create an identity or for our domain in SCS portal and you can see this again if you click here verified identities you will find us that this identity has been created and verify education is pending so this ACS doesn't know we are we on this domain so it it is asking us to verify this domain so what it says we have to publish these DNS records in our domain so you have to go to your DNS registrar well or where you are managing your domain so it may be uh code 80 it may be Route 53 or something else but I am maintaining my DNS on netlify so I will go there and I will select domain and in domain I will click here and here are my DNS records so in order to verify my domain what I will do I will just copy this cname and I will click here add new record I will select C name I will enter this I will remove dot code original.com because they will automatically append it and I will also copy the value so I will copy the value I will keep the time TTL short to solve it you know if something error something occurs then we can troubleshoot it quickly so I will just save this similarly I will create create all three records here so I will just select cname I will copy this and I will paste the value for this and again I will keep the timeout just one minute no timeout TTL yeah time to leave so again I will select C name and this is how I'm going to verify my domain so I have just saved okay so my all the three records all the three records with cname type have been added to my DNS settings and it should not take much time probably two or three minutes it should verify your account so I will click on verified entity sorry verified identities yeah so here you can see even 18 take one minute it immediately verified my account which is now coming in verified state so yeah that's the first step creating a verified identity so we have covered both the points which is creating a domain identity and then verifying it so now we will move to our next step so now we will understand how to receive email on business email ID that means okay so again I will take the example of my website and what we are going to do we are going to create a business email ID like mail at the rate quota journey.com so now if someone sends an email to mail at greatcoderjohny.com it should come to my email address and how what we are going to do uh basically let me open this so This architecture we are going to follow so let's understand this so that you will have an idea what we are going to do so you can see that this is a user and it is sending an email to mail at the red quarter johnny.com which is my domain okay so what will happen for example he is I mean in this architecture or in this diagram I am using the mail server is Gmail server so this user is sending an email from its Gmail account and that's why this mail request will come to this Gmail server and what this email server will do it will first check at coders only.com I mean where this coders only.com is registered so it will for example it is in either Route 53 or a form in my case it is netlify so it will go there and it will ask for MX record um MX record is something which is mail exchanger so it it tastes like waste the Dom mail domain is hosted for this uh for this domain I mean where is the mail server so now Route 53 or the netlifier whatever your domain provider will return the value of MX record which would be kind of an mail server which is capable of handling incoming emails so from here we will return some value and which would be a value of ACS server now the request will come to SCS server and this Gmail server will send this mail to SCS server and SCS will receive like there is a mail for coderjony.com and it knows that there is a verified identity so it will basically we will create some rules and using those rules what it will do it will save the incoming email to Amazon S3 bucket and then it will we will also create a Lambda function that will download the email from that S3 bucket and will send that email to my Gmail ID where I want that email to come in my Gmail box in Gmail inbox okay so that's the overall architecture we are going to follow so let me scroll down so here are the steps that we need to follow in order to achieve this so first thing they say publish MX records using very okay verify using MX toolbox we will do the verification later so first publish MX records okay so how we how we will get the you know these records MX records so for that I will just click on this okay because yeah I will show you why I click there and here you will see that uh you know once you click on that link you will find that publishing an MX record so uh what we are going to do we are going to publish an MX record here okay and and what should be the value of MX record so just select MX and you can you know click here imagine SCS region and endpoints from here you will click on email receiving and copy this value let me close this sorry so for North Virginia copy this value inbound SMTP U.S east one Amazon ACS just go there and copy sorry uh yeah keep it at the rate for the root domain Coda johnny.com and priority just type 10 and value will will be this again type 60 in TTL and when you come on this page you will see that they have explained like uh X for example.com they are using this 10 and inbounds SMTP then providing you the reason name so the same thing we have done here okay we have just applied the reason so we will create this DRS record okay and we'll save it so now what happens when an email server like this Gmail server sends an email to CODA Johnny so it will send the request to this netly file and it will ask what is the mail Exchange Server so from here it will you know reply with this this value inbound so it will respond with this value and then the Gmail server will send that email to this particular server okay so now we have to verify whether this MX record has been detected by the internet or not so we will go on this website so again I am saying that you can find the link of this page in the description below so here I will type coderjoni.com and see okay it is searching okay so it found this okay inbound SMTP Us East one so that means we have done it correctly I mean and preferences stand so we have done it correctly and so we can we are confident there okay let me close this so now next thing as I said that once the email comes at SCS service it is going to save the email in S3 bucket and will also trigger the Lambda function so for that we need to create these resources okay and I will also show you I mean how the email will be saved stored in S3 bucket and because we will set up some rules like like what should happen when an email arrives for this verified identity so we will set up those rules but for that you have to create an S3 bucket and Lambda function so I am close this page I will close this page okay and I am I will also close this page so you can I have provided a link here so you can follow this link to create the Lambda function and the IM role that would be required the S3 bucket policy that would be required so I will just keep this link open on this tab and I will come here I will first create an S3 bucket okay so I will just type S3 and I will click S3 and I will click click on create bucket type the name of S3 bucket and we'll scroll down to the bottom and we'll click on create bucket okay so I have created S3 bucket which is appearing here right quotas only SCS mails so as per this is this block which is you know also about the same topic that I am explaining you right now so you can just scroll down because they have also done the setup I mean also set up the domain here with the same way I have explained you so now configure S3 bucket now you have to copy this bucket policy and just open a notepad and I will open this notepad here and you have to replace the bucket name and account ID so what I will do I will go here and copy my account ID and here I will paste my account ID and I will copy the bucket name as well from here so what this policy is basically doing it is granting access to Amazon ACS service on this bucket okay and I will go in permissions inside bucket policy I will click on edit and I will save so this will allow SCS service to store the for I mean to store or save files on this S3 packet so we are granting SCS permissions so we have we are done with S3 we have created bucket we have created bucket policy now what we are going to do we are going to create a Lambda function so if you scroll down uh you see it is asking us to create a im policy enroll so what we are going to do we are going to again copy this I am policy and just paste it here and I will just replace the bucket name so again I will copy the bucket name so we need to replace the placeholder so what I will do I will replace the bucket name and account ID will go back copy the account ID from here account ID and Legion Legion Is Us East one so I will just type Us East 1 and we'll copy this so now I will go in my IM and this is the I am roll for Lambda function so I have to create that I am role first then we will create the Lambda function so my IM screen is loading so I will click on roles I will click on create role I will select trusted entity AWS service I will select here Lambda because Lambda is going to assume that role and I will click on create policy and inside this I will select Json and I will paste all this okay so we just got this policy from this AWS blog and we'll save this and this policy is basically allowing the Lambda function to write on S3 and it is also allowing it access to S3 because it is going to use S3 to send email and then Cloud watch access so I will just provide this um policies so some names so what I'm going to do I will provide this m role policy okay and I will save this create policy policy is created okay so I think okay I will have to find that policy here I have to refresh this I have to find that police here yeah I got the policy I attached it and clicked next then I will just type the role name quotation mail for forwarder I am role so okay so this is the role for the Lambda function that we are going to create next okay so the role is created so I will close this and then we are going to create the Lambda function so we'll just go on Lambda and again you have to copy all the code from here to create this python Lambda function so you can find the link of this block uh here okay so don't worry you will get there so what I will do I will create a function I will uh okay I had copied that code so I will paste it here and I will provide this name to my Lambda function ing mail forwarder and I will select python as runtime and here inside change execution role so I will select use an existing role and I will select the role that we created in previous step and then I will check advanced setting so not required I will click on create function so now next thing is need to update the course so we have to update the code there inside code just copy and paste it and deploy so we have okay we have updated the Lambda function as well so now we have to add few environment variables here so what we are what we are going to do I will go in configuration I will go in environment variables I will click edit add environment add add there are four values so male S3 prefix sorry here mail sender mail recipient and region okay and the value for this so for mail recipient I where I want uh where is mail sender okay mail recipient I didn't get so mail recipient would be the email address where I want to receive the email so I want to receive the email on my coderjony DOT web gmail.com which is my Gmail ID so I wanted any email that comes on my mail address only.com should be redirected on this Gmail mailbox and our SCS S3 bucket name is this and this is the prefix of uh of the I mean this would be the kind of folder in this S3 bucket where we will be storing our messages this is the region and the mail sender so this is the say from uh part you know once the email will end up in your Gmail box so what should be the from in that email so it could be anything because it will be using our codage only verified identity to Send email via SCS so it could be anything because we have verified our identity so you can type anything here you know just keep this at the rate quarters only.com part as it is but you know prefix could be anything just save this okay so now our function is also ready so I think we have done everything so we have published MX records we have verified it using MX tool we have created S3 bucket Lambda function using this block we have configured bucket policy I am roll okay now next thing the most important thing we are going to do next which is creating a rule set and Rule so I will go back to I will close this block now I will just go back in SCS now what I'm going to do is I just click on this and inside email receiving this will click here okay so we are going to create rules here so I will just delete this previous rule that I just created for testing so now what I am going to do I will create a new rule set and I will provide the name to this rule set this sorry I'll click on this rule set inside this rule set I will click a new rule so I will click here and I will enter a name coders only business email rule okay this is simple just leave this unticked I am not touching anything uh okay so now guideline okay just remove so here recipient condition so add a new recipient so I here you have to type in email address which you know you want to make a business email ID so I'm just typing a mail address coder shawnee.com okay so this would be my email ID where I want to receive my business email okay so you can type your business email ID here just click next now here uh the S3 bucket and Lambda will come into the picture so now what you want to do when the email is received by SCS so I just want to deliver it to uh S3 bucket so here I will select the S3 bucket which is only SCS mails and here the prefix which would be kind of a further folder inside this S3 bucket so we have provided business emails and I will not select SRS topic and so this is our first action so first it will store the object in S3 packet and after performing that action what we want to do next we want to invoke a Lambda function and inside the Lambda function I will select quarters only mail forwarder and yeah that's all okay so we'll just click next and okay so this is first action this is second action and will create rule okay so now it is asking us the permission so imagine ACS may not have necessary permission to access this Lambda function because uh we had edit permission in bucket but for uh Lambda function uh it is you know it wants some permission so that you know imagine SCS can call Lambda function we have added the permission to call uh SCS I mean to invoke SCS functions from Lambda function in that I am role but SCS don't have permission to call Lambda functions so it is asking us to add that permission and so either we can just click on the set permission or we can go on Lambda function and we can add a resource policy there so I will just click add permissions here now the rule is created and we are all set so what we are going to do we will just see that verified it all three precasted defines for receiving an email at this page which is basically setting up Amazon SCS email receiving so these three parts prerequisites are done because we have verified our domain we have also published MX records and we have also granted permissions to Amazon SCS for email receiving this is basically talking about permission to S3 bucket and Lambda function and all that so we are done with all the prerequisites so now we want to test if someone send an email to this mail at quarter johnny.com which works or not so I will go on this website and I will just type my email address which is mail at the red coder johny.com I think I just use the same name okay now I will select this and I will just click on send test okay so uh we I mean this is a great news in first attempt it is successful and I will just click on this and you can see oh it got bounced okay so why it got bounced ideally it should not get bounced it should be sent so okay so give me a minute I will troubleshoot it and we'll get back to you okay so I got the reason why this email got bounced so if I if we go in our ACS and we we see that if you know we have not activated this rule so we have to activate this uh recipient rule in the in our rule set so I will just select this and or or maybe we have to activate the entire we don't need to select it we have to activate entire rule set so just set as active so now it is a peric status inactive so earlier our rule set was DOT active so that's why emails were getting bounced so now I will just refresh this again and I will type my email ID mail at the red coder.com and I will just select this and we'll send it so I will close the previous one and will select this and it should be sent yeah now it is in send state so that means uh it the email has been delivered to this Amazon SCS inbound server and we have to verify it so we will go in our S3 bucket and see uh if the email is downloaded there or not so if we Sorry I just selected ROM bucket okay yeah sorry okay I will select this and you can see a business email folder has been created and inside this two uh email notification or two emails are there so this is the one which is just you know before one minute it got created and if I just download this okay so the email is downloaded on my local machine and if I just go there in and open it within notepad plus plus so you can see sorry so I will show you this so you can see uh this email is you know has been sent from this path and it is having in the bottom it is having its body message body so we have been success we have successfully set up how we can receive email on our S3 bucket but now what we are going to do we are going to close this and again we are going to go at our email address so I will open my Gmail and I will switch to my another account where which I had provided so okay we have not received the email here so I will check the Spam okay we did not get here so it may it it means that our Lambda function has not been invoked so we'll see uh we'll go here and hold Lambda function and we'll see the logs so I will just type monitor logs and view in Cloud watch so yeah the Lambda function has been invoked but why it failed okay email address is not verified okay so you can see this email address so it means that when it received the email and when it wanted to send that email to our another email ID which is codage only web gmail.com but that email ID is not verified because we are running this SCS in sandbox so what we have to do we have to just type SCS and then we have to add that email as a verified identity here so so that we can send the email there so I will just select email address and I will just type Coda Johnny dot web gmail.com and I will create an identity okay so the verification is pending again I will go to my Gmail account and from here I will just select my coronary web email ID I will close this and I got a verification email I will just verify Myself by clicking on this link and yeah my email is verified I can see that it is appearing as a verified identity here as well so now both identities are verified so now if I send an email again on mail at the at quarter journey.com from here this is my third email first code bomb second is successful now I just sent an another email from this website and let's see it is received here or not so you can see I have received an email in my Gmail account and this mail was basically sent to mail at the rate coderjunior.com and we use mail forwarder in our Lambda function and I have received this email and again the file that was you know I can access the file from here or I can download the mail from here as well now it is up to you how you want this you know because you might be thinking like I want to see the message here not this content so you can go to that Lambda function and you can modify the Lambda function to display the exact mail body here but this is how you can receive the email which have been sent on your business email ID so in the next part we will understand how we can send an email from our business email ID so now we have successfully received the email which which was sent on our business email ID in this step on or the last step we will see how we can send email from more business email ID so I will just close these tabs which are not required anymore so I will here just keep this inbox and yeah I will close this as well so what we are going to do in this we are going to follow three simple steps we are going to first create an SMTP user in Amazon ACS so here you will go on SCS screen and here you will find SMTP setting and you will just copy this SMTP endpoint so I will again open this notepad and I will just copy the endpoint here and okay I will keep like this and will Port 587 that that's fine I will create my SMTP credential here and I will provide this SMTP credential some name so I will just provide this codage only SMTP user okay and I will not touch this permission I will just click create user and I will copy my username and I will copy my password okay so I have my SMTP credentials ready for this SCS so I what I will do I will just go to my Gmail account so here I was receiving my receiving my emails and I also wanted I want to send email from mail@gmail.com from this Gmail client so what I will do I will go in more I will go in manage levels here you will go in accounts and import and scroll down you will find that send mail s so what this setting says you can use Gmail to send from your other email addresses so what you will do you will add another email address here and it will open a page like this and here you will type the name from which email address you want to send the email so you will use type mail88.com will treat it as an alias select next and here you will enter few details which we noted here so inside SMTP you will copy this value inside username you will copy this value and inside password you will copy this value and keep the port 587 and just click on add account okay so now what happens it will send us an email so that we can verify this okay mail at delete coderzoni.com like we we on this email so it has sent us an email so let's see whether we have received that email in our email box so we'll go here in inbox sorry um in an inbox and we have got another email which is this which we know which is a confirmation email so what I will do I will just download this and I will open this file in I will open a notepad and I will bring that file here so this is the email which has been sent by Google and here is the verification email so I just need to please click the link below to confirm your request and what I will do I will just hit enter and confirmation I will click confirm so once I click confirm then my email is verified like my ownership has been verified and now what I you what I will do I will again go back here in manage labels account and imports and yeah my email has been added there okay so uh now I will show you how we can send an email uh from this email ID to some other email address so again as we are running in sandbox environment in our uh because our ACS is not in production access so we can only send emails to verified identities so our verified identity is only this quarter Johnny web which is you know from where we are going to send the email itself so I will add another email address of mine which is my personal email address question 358 gmail.com and I will just click on create so I will open that email address and I got an email confirmation I will just click on this I got the confirmation I provided my confirmation that's fine so now what we are going to do we are going to receive an email here and for that I will I'm again in my quarterzone.web gmail.com account I will click on compose and while composing I will get two options I will get I want to send email from this or I want to send an email from this so I will just select this mail@coderjoy.com where I want to send the email I want to send the email to on question 358 gmail.com okay and what would be my subject this is testing SES okay and this is the description as well or the body as well I will just click send so let's see what happens why this button has been grayed out hmm strange okay let me compose another email I will select this I will select subject this here I will push chain T5 project Gmail [Music] I don't know why it is not sending email so let me again do a little bit troubleshooting I will be back in just one minute so I am back and honestly I did nothing I just refreshed this page and then after I tried sending one email and that was successful so I can again show you so I can just type this testing SES and from here I can select coder your email address in from and in two I can type again my email and question three five eight at gmail.com and again in the body as well testing SES so this should I call it two because I had sent one email in in when I was troubleshooting so I will just click on Save sorry send button and the email has been sent and here I should receive an email so I will just refresh this okay why it is not receiving email has been sent from here okay yeah I just got the email so you can see scs2 testing scs2 so uh that's how I mean I I just showed you that how can you quickly or not quickly it it may take some time but you can create a business email ID for uh completely free and yeah you can start using this business email ID for for your website or for your Enterprise whatever you want so that's what I had to cover in this video and I hope you have liked this video and if you find this video useful then please hit like button and you can also share my channel for more such content about AWS and Dot net thank you very much for watching
Info
Channel: Coderjony
Views: 11,993
Rating: undefined out of 5
Keywords: aws, amazon ses, receiving emails with amazon ses, business email
Id: LhkXP9Oli7U
Channel Id: undefined
Length: 40min 9sec (2409 seconds)
Published: Sun Jul 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.