Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure Meteor to use Amazon SES when running on Heroku?

I would like to use the built in email methods that Meteor provides, but I need my app to run on Heroku and use the smtp endpoint of Amazon SES to transport my message.

I'm using the Meteorite build pack and the accounts-password package.

like image 735
nate-strauser Avatar asked Jan 17 '13 21:01

nate-strauser


1 Answers

Follow instructions below to get meteor emails sending correctly from heroku using amazon ses

1) set up smtp access via aws console, get your smtp credentials

2) using a javascript console (chrome dev tools / firebug) run

encodeURIComponent("SES_SMTP_USERNAME")

encodeURIComponent("SES_SMTP_PASSWORD")

to encode the username/password for use in your smtp url

3) take resulting strings to build your smtp url like so

smtp://ENCODED_USER:ENCODED_PASS@SES_SMTP_URL:465

4) set the MAIL_URL variable to tell meteor to use this method for sending emails

heroku config:add MAIL_URL=YOUR_SMTP_URL

(do not surrond the url with qoutes)

5) set sender to be a SES verified sender within your meteor app via

Accounts.emailTemplates.from = "SENDER_NAME <SENDER_EMAIL>";


That will allow Meteor default email methods to function properly.

like image 195
nate-strauser Avatar answered Sep 28 '22 18:09

nate-strauser