admin管理员组文章数量:1022949
I am trying to send emails using nodemailer. Email is hosted on hostinger. Here is my configuration:
host: "smtp.hostinger",
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.
I am trying to send emails using nodemailer. Email is hosted on hostinger. Here is my configuration:
host: "smtp.hostinger.",
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.
- have you checked the settings of the host? For example I had a similar problem using G-Mail. If you use a G-Mail account you have to allow 3rd party apps to login with the credentials in the account settings. – db3000 Commented Jun 22, 2023 at 13:24
3 Answers
Reset to default 2Your 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.",
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,
},
it should work, but make sure to pass the mail option from the same hostinger email: export const mailOptions: nodemailer.SendMailOptions = { from: process.env.GRIEVANCE_EMAIL, to: whatever, subject: 'test', text: 'test', html: 'test' };
I am trying to send emails using nodemailer. Email is hosted on hostinger. Here is my configuration:
host: "smtp.hostinger",
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.
I am trying to send emails using nodemailer. Email is hosted on hostinger. Here is my configuration:
host: "smtp.hostinger.",
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.
- have you checked the settings of the host? For example I had a similar problem using G-Mail. If you use a G-Mail account you have to allow 3rd party apps to login with the credentials in the account settings. – db3000 Commented Jun 22, 2023 at 13:24
3 Answers
Reset to default 2Your 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.",
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,
},
it should work, but make sure to pass the mail option from the same hostinger email: export const mailOptions: nodemailer.SendMailOptions = { from: process.env.GRIEVANCE_EMAIL, to: whatever, subject: 'test', text: 'test', html: 'test' };
本文标签: javascriptHow to send email using nodemailer with hostinger professional emailStack Overflow
版权声明:本文标题:javascript - How to send email using nodemailer with hostinger professional email? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745559529a2156077.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论