Hi (or better HELO),
I have problem with sending e-mail from domainname.com. When mail is sending from www.domainname.com everything is ok.
This is an error:
550 Bad HELO - Host impersonating domain name.
I've just read SMTP specification and there is nothing about Host impersonating.
Can somebody tell me about this error? Because I'm not sure what this means.
My domain and hostname are different.
It's quite likely that it's objecting to your reverse DNS entry not matching, for example you connect from an IP and say EHLO domainname.com, the receiving server does a reverse lookup on that and finds www.domainname.com, which isn't an exact match, and so it complains/rejects. It's not an SMTP spec contravention, but it is common anti-spam, anti-forgery practice.
PHPMailer will derive the SMTP envelope sender address from the From address by default, but you can override that using the Hostname property (not the same thing as Host), for example:
$mail->From = '[email protected]';
$mail->Hostname = 'www.domainname.com';
SOLVED! Thank You!
```
$mail->Host = 'smtp.example.pl'; // Specify main and backup SMTP servers
$mail->SMTPDebug = 3;
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'secret';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('[email protected]', 'NicePack.pl');
$mail->Hostname = 'www.example.pl';
```
Hello,
How about If in my case when
$mail->Host = some.ip.address.ip4 ie 192.168.1.1;
because I have mail server on different hosting and this is the only way that I can send emails?
If you use an IP address for Host, you will get errors if you try to use encryption because the certificate names will never match. You can work around that by disabling verification. That said, if you're sending on your LAN, you don't really need encryption anyway, probably no auth either.
Most helpful comment
It's quite likely that it's objecting to your reverse DNS entry not matching, for example you connect from an IP and say
EHLO domainname.com, the receiving server does a reverse lookup on that and findswww.domainname.com, which isn't an exact match, and so it complains/rejects. It's not an SMTP spec contravention, but it is common anti-spam, anti-forgery practice.PHPMailer will derive the SMTP envelope sender address from the From address by default, but you can override that using the
Hostnameproperty (not the same thing asHost), for example: