DEV Community

Seth Phat
Seth Phat

Posted on

Laravel Mail Switcher

Hi guys,

Today I want to share a simple Library that I made for Laravel Application. It called Laravel Mail Switcher.

Github Repository: https://github.com/sethsandaru/laravel-mail-switcher

Use-case

You have a personal Laravel Application (small or medium) or even you're a Startup. Of course, you have a tight budget.

So you probably can't spend much money on Email Provider Services to send out your email to your Users/Customers.

There are a lot of Email Provider Services out there that actually give you a specific amount per month (for free) to send out emails.

So, with Laravel Mail Switcher, you will have a big advantage to achieve that. It will automatically switch to another email credential once the old one is out of usage for the current week/month.

You don't have to change the ENV every time one of the services is running out of usage.

You don't need to manually check to see if the email is running out.

All you need to do is prepare the credential/information and let Laravel Mail Switcher will do that for you.

Email Services with Free Usage

  • Mailgun: 5000 emails for 3-month (about 1666/month)
  • Mailjet: 6000 emails per month (but 200 per day)
  • Sendgrid: 100 emails per day (3000/month)
  • Socketlabs: 2000/month (first month: 40000)
  • Sendinblue: 300 per day (9000/month)

And many more... With Laravel Mail Switcher, you can manage the credentials and use all of them until the free usage ran out! Your applications would save a lot of money for emails!!

How to install?

Requirement

  • Laravel 8.x
  • PHP 7.4 or later

Installation

composer require sethsandaru/laravel-mail-switcher
Enter fullscreen mode Exit fullscreen mode

Visit this: Setting Guide to complete the installation!

In Conclusions

Personally, I got some personal projects and with this opportunity, I don't have to worry about emails anymore (Really budget projects 🤣)

Thanks for reading! Give it a ⭐ if you find out it's useful!

Oldest comments (0)