I will be happy to know if anyone has gotten an update regarding "Nodemailer and Outlook 365 SMPT, 535 5.7.139 Authentication unsuccessful not meet criteria" - or if I get a referral to where i can get related support.
Nodemailer and Outlook 365 SMPT, 535 5.7.139 Authentication unsuccessful not meet criteria
I am trying to send emails from my outlook account ( office 365 email ) to myself/ to others in my organization. And from my email to my users that may or may not be on office.
I am using Nodejs and Typescript and this is all happening on the server from my own email (our organizations email). So this should require no human interaction/ the access token or whatever shouldn't expire, need manual setting but rather this should be automatic or set once.
I tried the following setup
const mailOptions = {
from: "******@DOMAIN.AI",
to: "******@DOMAIN.AI",
subject: req.title,
text: req.contents,
};
const info = await transporter.sendMail(mailOptions);
export const transporter = nodemailer.createTransport({
service: "Outlook365",
auth: {
user: "******@DOMAIN.AI",
pass: "pass",
},
});
This is the error I am getting
[Node] error: Invalid login: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [VI1PR0501CA0022.eurprd05.prod.outlook.com]
This is happening on localhost while developing locally, but later I am gonna deploy this to heroku.
What I tried:
1) Tried this solution and enabled Authenticated SMPT
2) Tried using OAUTH and registering an azure project, but there are no resources on how to do SERVER-TO-SERVER communication instead of client to server.
What I need to happen:
1) I have personal email A in an organization and we have a shared inbox B. Ideally I'd be able to send email from B to B ( when user sends us a message it's send to the server and ideally we'd receive it in the shared inbox )
2) Be able to send from B (shared inbox ) to other users outside of our organization (the users of our apps). I mean I can send from personal email A but I'd like them to see the email B as from and to reply to email B
After hours of searching and reading the docs, I am unable to find whether or not this is possible. All solutions mention Azure and policies and such while I don't even use Azure in my app. I just need to send emails via our business email (shared inbox email) to ourself and to our users. I don't use any of the azure services, the docs are huge and are hard to navigate so I have no idea what is happening.