WIP
This commit is contained in:
parent
8734849511
commit
056d035805
6 changed files with 182 additions and 8 deletions
40
lib/email.js
Normal file
40
lib/email.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
var SMTPConnection = require('smtp-connection')
|
||||
|
||||
/*
|
||||
|
||||
Nice job signing up! Let's finish getting you set up.
|
||||
Simply change the settings in your email software to these:
|
||||
SMTP Server: mail.smtp2go.com
|
||||
SMTP Port: 2525 (recommended)
|
||||
Username: josh@lamassu.is
|
||||
Password: view / edit
|
||||
*/
|
||||
|
||||
var options = {
|
||||
port: 2525,
|
||||
host: 'mail.smtp2go.com',
|
||||
requireTLS: true
|
||||
}
|
||||
|
||||
function send (from, to, subject, body, cb) {
|
||||
var connection = new SMTPConnection(options)
|
||||
connection.connect(function () {
|
||||
connection.login({user: 'josh@lamassu.is', pass: 'HPtXGp}9baafiqns%6YFH'}, function (err) {
|
||||
if (err) return console.error(err)
|
||||
var envelope = {
|
||||
from: from,
|
||||
to: to
|
||||
}
|
||||
var message = 'Subject: ' + subject + '\n\n' + body
|
||||
connection.send(envelope, message, function (err, info) {
|
||||
connection.quit()
|
||||
cb(err, info)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
send('josh@lamassu.is', 'joshmh@gmail.com', 'Another test', 'Screen is stale.\n\nTest3', function (err, info) {
|
||||
console.log(err)
|
||||
console.log(info)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue