Skip to main content

Send Emails Using AJAX – Mandrill API Example

By January 14, 2016API, Blog, , Javascript, jQuery
Send Emails Using Ajax and Mandrill

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:

  1. register for Mandrill to get an API key
  2. load jQuery
  3. use $.ajax to send an email

Step 1: Get an API key from Mandrill

Get

Sign up for Mandrill. When you’re done, click on Get API Keys


Copy Mandrill API Key

On the next screen, press +Add API Key and copy your key

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.

allure

Author allure

More posts by allure

Leave a Reply

Designed by

best down free | web phu nu so | toc dep 2017