I am trying to use nodemailer using my Gmail address. It works when an email is sent to Gmail address but when I try to send mail to any Outlook address, it gets lost in the matrix. Help is appreciated. Thanks in advance.
let transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: "Mysendergmail", // generated ethereal user
pass: "password", // generated ethereal password
}
});
transporter.sendMail({
from: '"service@onlineshop" <Mysendergmail>', // sender address
to: "myoutlookreciever", // list of receivers
subject: "Hello ✔", // Subject line
text: "Hello world?", // plain text body
html: "<b>Hello world?</b>", // html body
},(err,info)=>{
if(err){
res.status(400).json(err)
}
else res.status(200).json("sent email")
});