Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error: Invalid login: 538 Error: Must issue a STARTTLS command first
- at SMTPConnection._formatError (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:591:19)
- at SMTPConnection._actionAUTHComplete (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:1320:34)
- at SMTPConnection._responseActions.push.str (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:356:26)
- at SMTPConnection._processResponse (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:747:20)
- at SMTPConnection._onData (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:543:14)
- at Socket._socket.on.chunk (/var/www/html/nodejs/node_modules/nodemailer/lib/smtp-connection/index.js:495:47)
- at Socket.emit (events.js:160:13)
- at addChunk (_stream_readable.js:269:12)
- at readableAddChunk (_stream_readable.js:256:11)
- at Socket.Readable.push (_stream_readable.js:213:10)
- var mysql=require('mysql');
- var express=require('express');
- var cors=require('cors');
- var nodemailer=require('nodemailer');
- const app=express();
- var bodyParser=require('body-parser');
- app.use(bodyParser.json());
- app.use(bodyParser.urlencoded({
- extended:true
- }))
- app.use(cors());
- const smtp = nodemailer.createTransport({
- service:'ethereal',
- host: 'smtp.ethereal.email',
- port: 587,
- secure:false,
- ignoreTLS:true,
- requireTLS:false,
- auth: {
- user: 'lu4rummljmr72anl@ethereal.email',
- pass: '9SYgdaYyQQPDAPm4CP'
- }
- });
- app.get('/',function(req,res) {
- return res.send({error:true,message:'working'});
- })
- app.get('/sent',function(req,res) {
- var mailoptions={
- from:'ewe***@***',
- to:'sdfs**@****',
- subject:'test',
- text:'hai'
- }
- smtp.sendMail(mailoptions,function(err,result) {
- if(err) throw err;
- console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));
- return res.send('send');
- })
- })
Add Comment
Please, Sign In to add comment