· 10 years ago · May 17, 2016, 02:45 PM
1var nodemailer = require('nodemailer');
2https.globalAgent.options.secureProtocol = "SSLv3_method";
3var smtpTransport = nodemailer.createTransport("SMTP",{
4 host: 'smtp.office365.com',
5 port: '995',
6 auth: { user: 'btcadmin', pass: '66whodat#@' },
7 secureConnection: 'false',
8 tls: { ciphers: 'SSLv3' }
9});
10
11{ [Error: Invalid greeting from server - +OK The Microsoft Exchange POP3 service is ready. [TOKEN]]
12data: '+OK The Microsoft Exchange POP3 service is ready. [TOKEN]',
13stage: 'greeting' }
14
15var mailOpts = {
16 from: "***@MICROSOFT-DOMAIN.com",
17 to: "******@gmail.com",
18 cc: "ME@gmail.com",
19 subject: "please work",
20 text: "nodemailer2.3.1 SMTP transporter plain text, vevent gen'd w/ icalevent, ical headers, no utf-8, request ical type, fs.write callback w/ CC, attached through file path array, gmail client (less secure enabled).",
21 attachments: [{
22 filename:"ICS.ics",
23 filePath: "./ICS.ics",
24 contentType: "text/calendar",
25 method: "request"
26 }]
27 };
28
29 smtpTransport.sendMail(mailOpts, function (a, b) { //err, null
30 console.log(a);
31 console.log(b);
32 sendJsonResponse(res, 200, "It worked?");
33 });