Using Cloudmailin
Cloudmailin is a great way to let your AppHarbor application receive emails with very little effort.
To use Cloudmailin, do the following:
- Provision the add-on from the catalog
- Follow the link to you Cloudmailin dashboard and configure the
url that you want Cloudmailin to
POST
to when an email is received. - Make sure that your application can receive
POST
from Cloudmailin at the target url
To accomplish item 3, you can use the controller action below:
[HttpPost]
[ValidateInput(false)]
public ActionResult Create(Email email)
{
return new EmptyResult();
}
With the Email class looking like this:
public class Email
{
public string From { get; set; }
public string Plain { get; set; }
public string Subject { get; set; }
}
You can add additional fields as required. All the fields posted by Cloudmailin are in their documentation.
Cloudmailin provides a great debugger for debugging your controller locally.
If you find that ASP.NET complains about dangerous requests, you
can add this to your web.config
:
<system.web>
<httpRuntime requestValidationMode="2.0" />
</system.web>