title: PHP: Why my Mail() Functions are not working?
body: <p>Hi I am trying to test my PHP mail function but it is not working. I have shared hosting all of my website mail function are not working</p>
  <pre><code>&lt;?PHP
  $sender = 'xx@gmail.com';
  $recipient = 'xx@gmail.com';
  
  $subject = &quot;php mail test&quot;;
  $message = &quot;php test message&quot;;
  $headers = 'From:' . $sender;
  
  if (mail($recipient, $subject, $message, $headers))
  {
      echo &quot;Message accepted&quot;;
  }
  else
  {
      echo &quot;Error: Message not accepted&quot;;
  }
  ?&gt;
  </code></pre>
  <p>I have also checked my php.ini if mail function is disabled but it is not disabled</p>
  <pre><code>disable_functions = 
  </code></pre>
  <p>I also tried using Easy WP SMTP Plugin. But it is not working. I am sure that my settings are correct.</p>
  <p>But this is what i got</p>
  
  <pre class="lang-html prettyprint-override"><code>SMTP ERROR: Failed to connect to server: Connection timed out (110)SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  </code></pre>
  <p>Thank you</p>