Example Code

Send Emails Easily using MailGun RESTful API

Code and Documents

Attachment

Download All

Introduction:

Sending e-mail or text messages through LabVIEW can be difficult when using a SMTP server.  This API allows the user to easily send these messages through a web-based service called MailGun.

Steps to Complete:

The API provided takes advantage of MailGun's RESTful API to send messages from LabVIEW.

In order to use these VI's, you must first sign up for an account at http://mailgun.org.  As of the time this was written, MailGun offered a free plan that allowed sending 200 messages per day.  Once the account is setup, only one VI is required to send an e-mail (or text message).

BD.png

Icon.png

Additional Information:

A VI is also included for checking for bounced e-mail messages.

Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
mprimrose
Member
Member
on

Sending email is a pain.  In addition to MailGun, Amazon offers their SES service which is a simple authenticated SMTP service.  More about Amazon SES here:

http://aws.amazon.com/ses/

I copied pricing information, current as of 2012-Sept-10, from Amazon's website below:

Pricing

Pay only for what you use. There is no minimum fee.

Free Tier
If you are an Amazon EC2 user, you can get started with Amazon SES for free. You can send 2,000 messages for free each day when you call Amazon SES from an Amazon EC2 instance directly or through AWS Elastic Beanstalk. Many applications are able to operate entirely within this free tier limit.

Note: Data transfer fees still apply. For new AWS customers eligible for the AWS free usage tier, you receive 15 GB of data transfer out aggregated across all AWS services, which should cover your Amazon SES data transfer costs. In addition, all AWS customers receive 1GB of free data transfer per month.

bgoolsby
Member
Member
on

I'm using LV 2015.  I set up a Mailgun account, but when I run the VI I get error 76401, Mailgun Error: Incorrect API Key.  I've checked the API key, even refreshed the key (got a new one) and tried that, but same error.  I'm not sure what should go in the "@mailgun domain" field - should this just be my domain name, like sandbox...f3f3.mailgun.org, or should there be a name and @ sign before the domain name?

Contributors