Hello there,
I am currently attempting to use Nodemailer in my Express.js server to send emails but it doesn't seem to work for me. I have used the verify function from Nodemailer to check if the connection via SMTP was successful and this is returned from the request:
```
{
"code": "EAUTH",
"response": "535 5.7.1 Authentication failed",
"responseCode": 535,
"command": "AUTH PLAIN"
}
```
Here is the code in Javascript I am using to send an email with Nodemailer with my custom domain:
```js
app.get('/mail/verify', (req, res) => {
var transporter = nodemailer.createTransport({
host: process.env.MAIL_HOST,
port: process.env.MAIL_PORT,
secure: process.env.MAIL_SECURE,
auth: {
user: process.env.MAIL_USER,
pass: process.env.MAIL_PASS
},
tls: {
rejectUnauthorized: false
},
});
transporter.verify((err, success) => {
if (err) {
res.send(err);
} else {
res.send('Server is ready to take our messages!');
}
});
});
```
These are the .env variables I am using:
```.env
MAIL_HOST = 'ssl0.ovh.net'
MAIL_PORT = 465
MAIL_SECURE = true
MAIL_USER = 'example@email.com'
MAIL_PASS = 'password'
```
If I replace 'ssl0.ovh.net' with the server of my Email Pro, I get a ETIMEOUT error. Does anyone know what may be causing this and what I can do to make this work?
Thank you for taking the time to read this and I look forward to any responses!
Nodemailer in Javascript with SMTP connection to Email Pro Email - Not Working
Related questions
- Mail quota exceeded - 200 limit
32769
03.04.2023 11:19
- email (catch all)
32762
16.03.2023 11:28
- I cannot make email address
28752
24.06.2020 07:35
- Error when i try to send mail from my gmail account to my webmail server
27299
03.01.2018 01:00
- Unable to receive mail from certain addresses
27277
13.05.2022 08:24
- Cannot access webmail
26754
01.03.2020 09:09
- My e-mails end up in spam
26653
11.07.2020 18:53
- Cost of the mx plans
26474
11.04.2022 08:40
- Redirect SPAM -> to spam folder
24617
13.04.2018 12:54
- Is it possible to enable DKIM verification for my domain on the MX PLAN email service?
23244
25.03.2022 21:36