Sending emails to users is becoming an increasingly popular feature. Social media influencers are amassing their own email lists for future product sales and brands are doing the same to ensure they can stay in touch with their users and maintain brand awareness. There are many SaaS companies being created to help people automate email sending. However, they do cost a pretty penny for very little work.

If you are a developer with basic skills in Node.js or Python, why not leverage AWS to create this from the ground up fairly quickly?

The use case for an email server is generally quite different than for an application server. An application server, particularly for a large application, values running 24/7 so it can respond to user queries faster. However, sending emails is a very small functionality that doesn’t require any state and is needed to run “on demand” rather than 24/7. This ticks all the boxes for a serverless architecture use case. Additionally, if we leverage AWS, we can see how easy it is to create such an architecture.

Let’s get started.


Step 1: Verifying an Email

Sign in to the AWS console and then go to the “SES” (Simple Email Service) section under “Services.” From here, go to “Email Addresses” on the left, click on “Verify a new Email Address,” and go through the email verification process. This will let you email through your email address. You will initially also be placed in a “Sandbox” environment where you can only send email to your verified email. Let’s go through this process first and get all the code set up. Then I will also show you how to email others.

SES Email verification


Step 2: Creating a Lambda Function

Once your email is verified, it is now time to create a Lambda. If you have read this article, you already know how to create one, but let’s go through it quickly here too. Let’s head over to the “Lambda” service in the AWS dashboard. Once here, click on the orange “Create function” button. Give it a name, keep all other settings the same, and click on “Create function.”

#serverless #nodejs #aws #programming #javascript

Send Emails Serverlessly With Node.js, Lambda, and AWS SES
1.65 GEEK