Title: EHLO Problem and Solved
Last modified: May 3, 2021

---

# EHLO Problem and Solved

 *  Resolved [joaquinferrero](https://wordpress.org/support/users/joaquinferrero/)
 * (@joaquinferrero)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/ehlo-problem-and-solved/)
 * Situation:
 * A website (www.mysite.com) is hosted on a site other than the one of your mail
   server (mail.mysite.com).
 * The website responds to both the mysite.com and [http://www.mysite.com](http://www.mysite.com)
   addresses
 * The Easy WP SMTP user correctly configures the options for the SMTP dialog.
 * Problem:
 * When the plugin generates the mail result of a form, the mail server on mysite.
   com it rejects it at the time of sending the EHLO command, with a similar message
   
   to this:
 * 2021-04-21 17:11:25 H=(mysite.com) [xx.xx.xx.xx] rejected EHLO or HELO mysite.
   com: No you are not ME or OURS (HELO was [mysite.com] and equal my local domains
   or my domains relay)
 * Cause of error:
 * When the plugin generates the mail result of a form, it makes use of the library
   PHPMailer. This library establishes a series of default values, which are used
   for the vast majority of cases. One of them is the value of $Ehlo variable. If
   this value is empty, the library takes the value of $Hostname variable. If this
   value is empty, it takes it from the name of the server where it is running.
 * As it turns out the site is set to mysite.com, that’s the name you use with the
   EHLO command. And when the mail arrives at the mail server, it rejects it because
   it does not support emails from machines other than his own (with the same name).
 * Immediate solutions (one of these):
 * 1- Change the name of the web server to [http://www.mysite.com](http://www.mysite.com),
   so that this is the value that PHPMailer take. This solution will not work if
   the reverse resolution of [http://www.mysite.com](http://www.mysite.com) is not
   correct (case of mail servers that check the direct AND inverse resolution names
   of incoming connections). For example, [http://www.mysite.com](http://www.mysite.com)
   resolve to xx.xx.xx.xx, and the inverse resolution of this IP are dns9198.phdns17.
   info, so the email is rejected.
 * 2- Configure the mail server so that it directly admits external emails from 
   mysite.com (this solution is a bit dangerous). If it can be restricted to the
   IP of [http://www.mysite.com](http://www.mysite.com), perfect.
 * 3- Edit the PHPMailer.php file to change the line
 * public $Helo = ”;
 * or the line
 * public $Hostname = ”;
 * to indicate the name (*NOT IP*) of the server that hosts [http://www.mysite.com](http://www.mysite.com)(
   for example, dns9198.phdns17.info). This solution is *not* maintainable – it 
   will be lost in the next library update.
 * Ideal solution:
 * Since PHPMailer does not consider the case of reading the default SMTP configuration
   from an external file, nor from the global variables of WordPress, the plugin
   should allow editing the value of Ehlo or Hostname, taking the first default 
   value the name of the web server where it is running or take it from the name
   of the mail server that is being indicated. Most users would not need fill in
   this field, so it should be filled in automatically, ideally in the time to show
   the plugin for the first time.
 * JF

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [joaquinferrero](https://wordpress.org/support/users/joaquinferrero/)
 * (@joaquinferrero)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/ehlo-problem-and-solved/#post-14394467)
 * 4- Adding an add_action() to functions.php, like this thread:
    [https://wordpress.org/support/topic/ehlo-protocol-issue/](https://wordpress.org/support/topic/ehlo-protocol-issue/)
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/ehlo-problem-and-solved/#post-14395322)
 * Hi,
 * What type of server is your site hosted in? What contact form are you running
   in your site?
 * Thank you
 *  Thread Starter [joaquinferrero](https://wordpress.org/support/users/joaquinferrero/)
 * (@joaquinferrero)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/ehlo-problem-and-solved/#post-14396746)
 * Linux Debian v9
    Apache v2.4.25 webserver Fast-CGI for PHP v7.0, v7.3 and v7.4
   Exim4 mailserver Wordpress v5.7.1 with contact forms: acumbamail-signup-forms
   contact-form-7
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/ehlo-problem-and-solved/#post-14399991)
 * Thank you for reporting back. Your server specs looks okay to me. However most
   users don’t run into this issue. It could be related to the contact form plugin
   you are using or some settings in your email server that might be causing this
   issue.
 * Anyhow it is good that you found a solution and shared it here. I am sure this
   will help others running into the same issue as you.
 * Kind regards

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘EHLO Problem and Solved’ is closed to new replies.

 * ![](https://ps.w.org/easy-wp-smtp/assets/icon.svg?rev=3158017)
 * [Easy WP SMTP – WordPress SMTP and Email Logs: Gmail, Office 365, Outlook, Custom SMTP, and more](https://wordpress.org/plugins/easy-wp-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-wp-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-wp-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-wp-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-wp-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-wp-smtp/reviews/)

## Tags

 * [helo](https://wordpress.org/support/topic-tag/helo/)
 * [phpmailer](https://wordpress.org/support/topic-tag/phpmailer/)

 * 4 replies
 * 2 participants
 * Last reply from: [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/ehlo-problem-and-solved/#post-14399991)
 * Status: resolved