Created
September 15, 2013 04:58
-
-
Save shiny/6568144 to your computer and use it in GitHub Desktop.
send mail from mailgun.
# how to use 1. npm install request
2. change: your mailgun api key; change your domain in request url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request = require 'request' | |
form = | |
from: 'shiguanglu <[email protected]>' | |
to: 'testuser <[email protected]>' | |
subject: 'this is a test mail' | |
text: 'test mail body' | |
auth = | |
user: 'api' | |
password: 'YOUR API KEY FROM MAILGUN' | |
request.post 'https://api.mailgun.net/v2/samples.mailgun.org/messages',{form: form , auth:auth }, (e, r, body)-> | |
console.log e | |
console.log body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment