Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Java
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
conf
public
test
.gitignore
README.md

README.md

A Simple Play + SendGrid Example App

Setup

Set the production mail config in the conf/applicaiton.conf file:

%prod.mail.smtp.host=smtp.sendgrid.net
%prod.mail.smtp.user=${SENDGRID_USERNAME}
%prod.mail.smtp.pass=${SENDGRID_PASSWORD}

Sending Email

MultiPartEmail email = new MultiPartEmail();
email.setFrom(fromAddress);
email.addTo(toAddress);
email.setSubject(subject);
email.setMsg(msg);
Mail.send(email);

Deploy on Heroku

Create a new app on Heroku

heroku create -s cedar

Add the SendGrid Add-On

heroku addons:add sendgrid

Deploy the app:

git push heroku master
Something went wrong with that request. Please try again.