I am writing a function for sending magic links to new users.
public async sendMagicLink(email: string) {
const transporter = mailer.createTransport({
host: 'smtp.ukr.net',
port: 465,
secure: true,
auth: {
user: 'myemail',
pass: 'my password',
},
});
transporter.verify().then(console.log).catch(console.error);
}
And the code fails with this error.
Error: Invalid login: 535 Incorrect authentication data
at SMTPConnection._formatError
Credentials are 100% correct. Does anyone have any ideas about what might have gone wrong? I have tried all solutions possible both from stack overflow and github.
And if I set port:2525 and secure: false I get Error: Greeting never received and greetingTimeout doesn't help.