summaryrefslogtreecommitdiffstats
path: root/lib/sendgrid.js
diff options
context:
space:
mode:
authorscottmotte <scott@scottmotte.com>2013-08-15 20:15:20 +0000
committerscottmotte <scott@scottmotte.com>2013-08-15 20:15:20 +0000
commit64e2af96293c9b9c0d2c7bbaee8dfeeb1f3d21a7 (patch)
tree66fb72e3984e6d4b1173126170e8938b72fd6cfc /lib/sendgrid.js
parentd419992052c43ca30b356b73b9dfc74d01f2dffd (diff)
downloadsendgrid-nodejs-64e2af96293c9b9c0d2c7bbaee8dfeeb1f3d21a7.zip
sendgrid-nodejs-64e2af96293c9b9c0d2c7bbaee8dfeeb1f3d21a7.tar.gz
sendgrid-nodejs-64e2af96293c9b9c0d2c7bbaee8dfeeb1f3d21a7.tar.bz2
Version bump 0.3.0-rc.1.3 - add ability to change port to 465 and send over ssl. 587 still recommended because some hosts rate limit 465.v0.3.0-rc.1.3
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r--lib/sendgrid.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js
index ee25b3c..6ae564b 100644
--- a/lib/sendgrid.js
+++ b/lib/sendgrid.js
@@ -95,13 +95,20 @@ module.exports = function(api_user, api_key) {
var _sendSmtp = function(email, callback) {
// SMTP settings
- var smtpTransport = nodemailer.createTransport(self.SMTP, {
- service: 'SendGrid',
+ var smtp_settings = {
+ host: "smtp.sendgrid.net",
+ port: parseInt(self.port),
+ requiresAuth: true,
auth: {
user: api_user,
pass: api_key
}
- });
+ }
+ if (smtp_settings.port == 465) {
+ smtp_settings['secureConnection'] = true;
+ }
+
+ var smtpTransport = nodemailer.createTransport(self.SMTP, smtp_settings);
smtpTransport.sendMail(email.toSmtpFormat(), function(error, response) {
smtpTransport.close();
@@ -117,6 +124,7 @@ module.exports = function(api_user, api_key) {
*/
return {
version : package_json.version,
+ port : 587,
SMTP : "SMTP",
Email : Email,
SmtpapiHeaders : SmtpapiHeaders,