A Handy SaaS App: CloudMailin

A couple of years ago I was working on a little prototype web app. Part of that app required the ingest of email messages, which would then be further processed. Now, it wasn’t a huge issue to pipe the emails through some code I had written, but that required messing around at a lower level than I would have liked, and was somewhat server specific. It would have been nice to avoid the issue altogether. That’s where CloudMailin fits in. It offers simple incoming email processing for your web apps.

An example of how this can be useful: your support app sends emails to customers. You want to be able to ingest any replies to those emails back into your system. With CloudMailin , you can do so quickly and easily. Setup is pretty simple:

First, create an email address to be used with your app. The free tier doesn’t support custom domains (e.g. ericbrandel.com), but some of the paid tiers do:

CloudMailin - Email Addresses
CloudMailin – Email Addresses

When creating the email address you specify where you want the message posted, and the format you want it in. You can have the message posted in a number of formats, including JSON.

CloudMailin - Add Address
CloudMailin – Add Address

Hit submit and that’s it. Any email you send to that address will now post to the URL you specified. The Quickstart Guide will get you going with some easy examples in Java, .Net, PHP, Python, Ruby, and more. An example of ingesting the standard HTTP POST format with PHP:

  $from = $_POST['from'];
  $to = $_POST['to'];
  $plain_text = $_POST['plain'];

  header("Content-type: text/plain");

  if ($to == 'allowed@example.com'){
    header("HTTP/1.0 200 OK");
    header("HTTP/1.0 403 OK");
    echo('user not allowed here');

Obviously you would want to do more than just echo a message back, but you get the idea. You can also monitor your message history through their dashboard and view any messages that have been ingested.

CloudMailin - Message History
CloudMailin – Message History

There’s a free/dev tier to get started and it’s also available as an add-on with both AppFog and Heroku. The paid service tiers also include the ability to accept attachments and save them to Amazon S3, which is another very nice option. If you’re looking for a good option to make ingesting emails a breeze, CloudMailin should be a nice fit.

This entry was posted in Cloud, PHP, SaaS and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *