Я пытаюсь отправить электронное письмо, используя адрес отправителя gmail, из формы ввода, используя nodemailer, node.js и express. Я продолжаю получать код ответа об ошибке 554. Поэтому я установил и потребовал SMTP-транспорт и все еще получаю ошибки. Я пропускаю шаг с настройкой nodemailer, который вызывает эту ошибку
app.j
var Express = require("express");
var app =Express();
var port = process.env.PORT || 3000;
app.set("view engine", "ejs");
var bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({extended: true}));
var smtpTransport = require('nodemailer-smtp-transport');
var nodemailer= require("nodemailer");
var transporter=nodemailer.createTransport(smtpTransport({
service: 'outlook',
auth: {
user: 'antonyt@live.com',
pass: 'passcode123'
}
}));
app.use(Express.static("public"));
var images=[
{name: "Logo", image:"/images/pic.png"},
{name: "Logo", image:"/images/beforeboat.jpg"},
{name: "Logo", image:"/images/completedboat.jpg"},
{name: "Logo", image:"/images/inprogressboat.jpg"},
{name: "Logo", image:"/images/pic.png"},
{name: "Logo", image:"/images/beforeboat.jpg"},
{name: "Logo", image:"/images/completedboat.jpg"},
{name: "Logo", image:"/images/inprogressboat.jpg"},
{name: "Logo", image:"/images/completedboat.jpg"},
{name: "Logo", image:"/images/inprogressboat.jpg"},
{name: "Logo", image:"/images/pic.png"},
{name: "Logo", image:"/images/beforeboat.jpg"},
{name: "Logo", image:"/images/completedboat.jpg"},
{name: "Logo", image:"/images/inprogressboat.jpg"},
{name: "Logo", image:"/images/completedboat.jpg"},
{name: "Logo", image:"/images/inprogressboat.jpg"},
{name: "Logo", image:"/images/pic.png"},
{name: "Logo", image:"/images/beforeboat.jpg"},
{name: "Logo", image:"/images/completedboat.jpg"},
{name: "Logo", image:"/images/inprogressboat.jpg"}]
app.get("/gallery", function(req, res){
res.render("gallery",{images:images});
});
app.get("/", function(req, res){
res.render("home");
});
app.get("/contact", function(req, res){
res.render("contact");
});
app.post("/contact", function(req, res){
var name = req.body.name;
var email = req.body.email;
var message= req.body.message;
var mailOptions={
from: email,
to: 'antonyt@live.com',
subject: req.body.name,
text: req.body.message
};
transporter.sendMail(mailOptions,
function(error,info){
if(error){
console.log(error);
}
else{
console.log('email sent:' + info.response);
}
});
});
app.listen(port, function(){
console.log("Server started boys!")
});
contact.ejs
<% include header %>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div id="contactitle" >
<h2 class="ml-auto mr-auto">Contact</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="jumbotron">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<form action="/contact" method="POST" class="ml-auto mr-auto">
<div class="form-group">
<label for="name"> Name: </label>
<input class="form-control" type="text" id="nameinput" name="name"></input>
</div>
<div class="form-group">
<label for="email"> Email: </label>
<input class="form-control" type="text" id="emailinput" name="email"></input>
</div>
<div class="form-group">
<label for="messagebox"> Message: </label>
<textarea class="form-control"id="messagebox" name="message" rows="5" cols="50">
</textarea>
</div>
<button type="submit" class="btn btn-primary btn-block"> SEND </button>
</form>
</div>
</div>
</div>
<% include footer %>
ошибки рис.
PowerShell cmd line ошибки сервера код ответа: 554