I am trying to send emails using nodemailer. Email is hosted on hostinger. Here is my configuration:
host: "smtp.hostinger.com",
port: 465,
secure: true,
auth: {
user: process.env.GRIEVANCE_EMAIL,
pass: process.env.GRIEVANCE_EMAIL_PASSWORD,
},
But every time I encounter this error:
Error occurred while sending the email: Invalid login: 535 5.7.8 Error: authentication failed:
user and pass is correct as i log into hostinger webmail with the same credentials. I tried setting secure: false
, adding tls: {rejectUnauthorized: false}
but nothing works. I have to deploy the project in 2 days, event ChatGPT can't help me.
Your configuration is only missing the correct host name. Hostinger uses titan rather than hosting webmails itself. Should look like the following:
host: "smtp.titan.email",
port: 465,
secure: true,
auth: {
user: process.env.GRIEVANCE_EMAIL,
pass: process.env.GRIEVANCE_EMAIL_PASSWORD,
},
The problem got solved using this configuration:
host: "smpt.hostinger.com",
secure: true,
secureConnection: false,
tls: {
ciphers: "SSLv3",
},
requireTLS: true,
port: 465,
debug: true,
connectionTimeout: 10000,
auth: {
user: process.env.GRIEVANCE_EMAIL,
pass: process.env.GRIEVANCE_EMAIL_PASSWORD,
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With