forked from totaljs/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (19 loc) · 919 Bytes
/
Copy pathindex.js
File metadata and controls
27 lines (19 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var framework = require('total.js');
var mail = require('total.js/mail');
var message = new mail.Message('Subject', 'Body');
message.to('petersirka@gmail.com');
// message.cc('@');
// message.bcc('@');
// message.reply('@');
// message.attachment('/filename.txt', 'name.txt');
message.from('jankohrasko@gmail.com', 'Janko Hrasko');
mail.on('error', function (err) {
console.log(err);
});
// SEND via GMAIL
// message.send('smtp.gmail.com', { port: 465, secure: true, user: 'ENTER_YOUR_EMAIL', password: 'ENTER_YOUR_PASSWORD' });
// SOLUTION [Error: SELF_SIGNED_CERT_IN_CHAIN]: message.send('smtp.gmail.com', { port: 465, secure: true, user: 'ENTER_YOUR_EMAIL', password: 'ENTER_YOUR_PASSWORD', rejectUnauthorized: true });
// SEND via AUTH BASIC SMTP
// message.send('smtp.yourdomain.com', { user: 'ENTER_YOUR_EMAIL', password: 'ENTER_YOUR_PASSWORD' });
// SEND via SMTP
// message.send('smtp.yourdomain.com');