Created
April 11, 2013 18:00
-
-
Save stewartjarod/5365678 to your computer and use it in GitHub Desktop.
Send email with attachment Second Method... Should work with Azure.
This file contains hidden or 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
var sg = require('sendgrid'); | |
var email = new sg.Email({ | |
to: '[email protected]', | |
toname: 'Test Person', | |
from: '[email protected]', | |
fromname: 'Test Sender', | |
subject: 'Email Test with Image', | |
text: 'This is a test.', | |
html: 'this is a test <img src="cid:testme" alt="graphic"/>', | |
}); | |
email.addFile({ | |
filename: 'SendGrid.png', | |
url: 'http://i.techgox.com/img/companies/startups/SendGrid.png' | |
}); | |
var sendgrid = new sg.SendGrid('username','password'); | |
sendgrid.send(email, function(success, error) { | |
if(!success) console.error(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment