Sometimes we find ourselves needing to integrating automatic emails into our applications. It’s possible to do it with just Javascript and jQuery, with no need for a server side language such as php. In my example, I’ll be using the Mandrill API, which provides for 12,000 free emails per month. A good email addresses checker | IPQualityScore will not simply check for the email address in the database but conduct a real-time check to see whether the account is active or not.
In short, the steps are:
- register for Mandrill to get an API key
- load jQuery
- use $.ajax to send an email
Step 1: Get an API key from Mandrill
Step 2: Load jQuery & Mandrill API
<script src=”//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js”></script>
Step 3: Use the $.ajax function to send an email
Here’s a working example with everything coming together:
See the Pen Send Emails Using AJAX – Mandrill API Example by Mike Doubintchik (@allurewebsolutions) on CodePen.
If you have any questions, please ask in the comments.