Guest User

Untitled

a guest
Feb 15th, 2018
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. Error: Invalid login: 538 Error: Must issue a STARTTLS command first
  2. at SMTPConnection._formatError (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:591:19)
  3. at SMTPConnection._actionAUTHComplete (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:1320:34)
  4. at SMTPConnection._responseActions.push.str (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:356:26)
  5. at SMTPConnection._processResponse (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:747:20)
  6. at SMTPConnection._onData (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:543:14)
  7. at Socket._socket.on.chunk (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:495:47)
  8. at Socket.emit (events.js:160:13)
  9. at addChunk (_stream_readable.js:269:12)
  10. at readableAddChunk (_stream_readable.js:256:11)
  11. at Socket.Readable.push (_stream_readable.js:213:10)
  12.  
  13. var mysql=require('mysql');
  14. var express=require('express');
  15. var cors=require('cors');
  16. var nodemailer=require('nodemailer');
  17. const app=express();
  18. var bodyParser=require('body-parser');
  19. app.use(bodyParser.json());
  20. app.use(bodyParser.urlencoded({
  21. extended:true
  22. }))
  23. app.use(cors());
  24. const smtp = nodemailer.createTransport({
  25. service:'ethereal',
  26. host: 'smtp.ethereal.email',
  27. port: 587,
  28. secure:false,
  29. ignoreTLS:true,
  30. requireTLS:false,
  31. auth: {
  32. user: 'lu4rummljmr72anl@ethereal.email',
  33. pass: '9SYgdaYyQQPDAPm4CP'
  34. }
  35. });
  36. app.get('/',function(req,res) {
  37. return res.send({error:true,message:'working'});
  38. })
  39. app.get('/sent',function(req,res) {
  40. var mailoptions={
  41. from:'ewe***@***',
  42. to:'sdfs**@****',
  43. subject:'test',
  44. text:'hai'
  45. }
  46. smtp.sendMail(mailoptions,function(err,result) {
  47. if(err) throw err;
  48. console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));
  49. return res.send('send');
  50. })
  51. })
Add Comment
Please, Sign In to add comment