Follow us

How to send bulk email in Laravel with Amazon (AWS) SES

Sending bulk email in Laravel with Amazon SES allowed sending Limit, this will be useful if you want to send more emails per seconds to your customer and users.

The best email support for Laravel - Amazon's Simple Email Service (SES)

Amazon SES posses hard limits on number of emails it can send per second. So if our application breaks this limit, SES will discard emails over that limit. This is not a problem when sending transactional emails, when sending campaigns it is important to keep track of sending speed.

With sand box access you can send email to verified emails in SES. If you want to move out of sand box, you have to request for SES sending limit increase. Once you have moved out of sand box, you can start sending more emails to your users on a limit per second basis.

Steps to send bulk email in Laravel with Amazon (AWS) SES

Create User Credentials with Amazon SES

Configure Laravel to Use Your Amazon SES Credentials

Configuring and installing Amazon AWS SDK in Laravel

Send bulk email with AWS API in Laravel

Step 1. Create User Credentials with Amazon SES

When you login into AWS go to the list of Amazon web services, there you need to select SES.

Amazon Web Services List

After selecting SES you will be redirected to SES Dashboard. There you can see sending limits, number of sent emails and some metrics.

SES Dashboard

New user accounts on SES are in sandbox mode, and they can send emails only to verified emails in SES with certain sending limt. By requesting a sending limit increase you will get better sending speed, and your app will be able to send emails to any address.

AWS SES posses a great API, which can be useful for huge email campaigns. To generate new set of keys you have to visit Account - My Security Credentials.

By clicking on Get Started with IAM Users button you will be redirected to IAM's page. IAM is AWS system for identity management ( simplified: generating keys for different AWS services ). Create your user account and get your Access Key and Secret Key.

Inserting SMTP details in .env file

If need to send bulk emails, you can give your Aws credentials in the file which you are sending email. For our Laravel applications use can use any Queue service like, Redis, Amazon SQS, Beanstalk and many more. For our project we will be using Beanstalk as Queue. For installation details and sending emails over queue please read our tutorial dedicated to Beanstalk and Laravel Queue.

If you are in testing phase you can use sync driver or databse for queue, that will mimic queue without actually using it. This helps you code everything like there is a queue, but without really configuring it.