Sending Email from Cloud Foundry Java Applications with SendGrid

by November 25, 2013

The following is a guest blog post by Scott Motte (@scottmotte), Developer Evangelist at SendGrid, a cloud based SMTP email delivery and management service.
A few weeks ago SendGrid released their sendgrid-java helper library. The library goes a step further in sticking with Cloud Foundry’s “it just works” experience and making your life as a developer easier. Previously, you had to write a large amount of boilerplate code using JavaMail. Now, you can send email with just a few lines of code.
How Does It Work?
At your Cloud Foundry Command Line Interface, add SendGrid as a service and bind it your app.
cf create-service sendgrid
cf bind-service

Next, Install the vcapenv library, and install the sendgrid-java library.