Hi,
Firstly thanks for the great tool you made. I was working on using it with cPanel's email id on shared server. I ended up with these logs
SERVER 1:
βββ220-md-in-6.webhostbox.net ESMTP Exim 4.85 #2 Thu, 18 Jun 2015 09:12:14 +0000
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
CLIENT 1:
βββEHLO [127.0.0.1]
SERVER 1:
βββ250-md-in-6.webhostbox.net Hello [127.0.0.1] [182.69.86.155]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
CLIENT 1:
βββSTARTTLS
SERVER 1:
βββ220 TLS go ahead
Connection secured
CLIENT 1:
βββEHLO [127.0.0.1]
SERVER 1:
βββ250-md-in-6.webhostbox.net Hello [127.0.0.1] [182.69.86.155]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP
CLIENT 1:
βββAUTH PLAIN AGluZm9Ac29sb21vZnkuY29tAEI5XlR3P3Zz
SERVER 1:
βββ235 Authentication succeeded
CLIENT 1:
βββMAIL FROM:
βββ501
data: '501
Closing connection to the server
Let me know how do I configure this. I am using this setting as of now:
var smtpTransport = nodemailer.createTransport("SMTP", {
host: "mail.domain.com", // hostname
secureConnection: false, // TLS requires secureConnection to be false
port: 587, // port for secure SMTP
auth: {
user: "[email protected]",
pass: "password"
},
debug:true,
tls: {
rejectUnauthorized: false
}
});
Thanks,
Abhishek Jain
Check the from
address. Your server does not allow FROM address that uses domain literals. If you did not define the from
address, then a default address is generated which might include the domain literal. Make sure that you always use a valid from
address when sending emails.
Awesome man! Thanks.
Solution for mean Stack: Just define a mail id in config.mailer.from which is not blocked by cPanel.
I have same issue.
Where is the config.mailer.from ?
I changed sender name as Gmail Account name but it doesn't send again.
Updated: Changed unsecure access option in gmail settings and fixed.
@pozitivexx whenever you are sending mails, just make sure you are using right from address.
In below example set mailOptions.from = smtpConfig.auth.user to make sure mail delivers. This is cPanel/Host configuration. Contact hosting partner for more details.
// setup e-mail data with unicode symbols
var mailOptions = {
from: '"Fred Foo π₯" [email protected]', // sender address
to: '[email protected], [email protected]', // list of receivers
subject: 'Hello β', // Subject line
text: 'Hello world π΄', // plaintext body
html: 'Hello world π΄' // html body
};
you will need SSL config to make it perfect,
let transporter = nodemailer.createTransport({
host: 'SOMEDOMAIN.com',
port: 465, // Port
secure: true, // this is true as port is 465
auth: {
user: '[email protected]',
pass: 'password'
}
});
it's work for me..without any issue
Most helpful comment
Check the
from
address. Your server does not allow FROM address that uses domain literals. If you did not define thefrom
address, then a default address is generated which might include the domain literal. Make sure that you always use a validfrom
address when sending emails.