Last active
August 10, 2022 20:38
-
-
Save andris9/93b59500e8b61a59ca21 to your computer and use it in GitHub Desktop.
Nodemailer using Mandrill
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
'use strict'; | |
// Nodemailer: v2.0.0 | |
// Ubuntu: 14.04 | |
// node: v5.5.0 | |
// npm: 3.3.12 | |
var nodemailer = require('nodemailer'); | |
var transporter = nodemailer.createTransport({ | |
service: 'Mandrill', | |
auth: { | |
user: '[email protected]', | |
pass: 'VALID_API_KEY' | |
}, | |
logger: true, // log to console | |
debug: true // include SMTP traffic in the logs | |
}, { | |
from: 'Andris Reinman <[email protected]>' | |
}); | |
// Message object | |
var message = { | |
to: '"Andris Reinman" <[email protected]>', | |
subject: 'Nodemailer is unicode friendly ✔', // | |
text: 'Hello to myself!' | |
}; | |
transporter.sendMail(message).then(info => { | |
console.log('Server responded with "%s"', info.response); | |
}).catch(err => { | |
console.log('Error occurred'); | |
console.log(err.message); | |
}); |
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
2016-01-31 17:04:18] INFO: Sending mail using SMTP/2.0.0[client:2.0.0] | |
[2016-01-31 17:04:18] INFO: [1gJLxuUSxz0] Connection established to 54.72.103.126:587 | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] S: 220 smtp.mandrillapp.com ESMTP | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] C: EHLO [127.0.0.1] | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] S: 250-relay-5.eu-west-1.relay-prod | |
250-PIPELINING | |
250-SIZE 26214400 | |
250-STARTTLS | |
250-AUTH PLAIN LOGIN | |
250-ENHANCEDSTATUSCODES | |
250 8BITMIME | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] C: STARTTLS | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] S: 220 2.0.0 Ready to start TLS | |
[2016-01-31 17:04:18] INFO: [1gJLxuUSxz0] Connection upgraded with STARTTLS | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] C: EHLO [127.0.0.1] | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] S: 250-relay-5.eu-west-1.relay-prod | |
250-PIPELINING | |
250-SIZE 26214400 | |
250-AUTH PLAIN LOGIN | |
250-ENHANCEDSTATUSCODES | |
250 8BITMIME | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] SMTP handshake finished | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] C: AUTH PLAIN {*AUTH DATA*} | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] S: 235 2.7.0 Authentication successful | |
[2016-01-31 17:04:18] INFO: [1gJLxuUSxz0] User "[email protected]" authenticated | |
[2016-01-31 17:04:18] INFO: Sending message <> to <[email protected]> | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] C: MAIL FROM:<[email protected]> | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] S: 250 2.1.0 Ok | |
[2016-01-31 17:04:18] DEBUG: [1gJLxuUSxz0] C: RCPT TO:<[email protected]> | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] S: 250 2.1.5 Ok | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] C: DATA | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] S: 354 End data with <CR><LF>.<CR><LF> | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] C: Content-Type: text/plain | |
From: Andris Reinman <[email protected]> | |
To: Andris Reinman <[email protected]> | |
Subject: Nodemailer is unicode friendly =?UTF-8?Q?=E2=9C=94?= | |
X-Mailer: nodemailer (2.0.0; +http://nodemailer.com/; | |
SMTP/2.0.0[client:2.0.0]) | |
Content-Transfer-Encoding: 7bit | |
Date: Sun, 31 Jan 2016 17:04:18 +0000 | |
Message-Id: <[email protected]> | |
MIME-Version: 1.0 | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] C: Hello to myself! | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] C: | |
. | |
[2016-01-31 17:04:19] INFO: [1gJLxuUSxz0] C: <440 bytes encoded mime message (source size 435 bytes)> | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] S: 250 2.0.0 Ok: queued as E7224480BF7 | |
[2016-01-31 17:04:19] DEBUG: [1gJLxuUSxz0] Closing connection to the server using "end" | |
Server responded with "250 2.0.0 Ok: queued as E7224480BF7" | |
[2016-01-31 17:04:19] INFO: [1gJLxuUSxz0] Connection closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment