title: CPanel : Unable to send Mail using PHP
body: <p>i have a code that should send mail in php using cpanel , I don't know why it is not working in Cpanel , it is not throwing error too , i gave try catch, but it is not catching any exception. Since am new to Cpanel. I am not able to understand what is the issue</p>
  <pre><code>&lt;html&gt;
     
     &lt;head&gt;
        &lt;title&gt;Sending HTML email using PHP&lt;/title&gt;
     &lt;/head&gt;
     
     &lt;body&gt;
        
        &lt;?php
        try{
           $to = &quot;name@doman1.com&quot;;
           $subject = &quot;This is subject&quot;;
           
           $message = &quot;&lt;b&gt;This is HTML message.&lt;/b&gt;&quot;;
           $message .= &quot;&lt;h1&gt;This is headline.&lt;/h1&gt;&quot;;
           
           $header = &quot;From:name2@gmail.com \r\n&quot;;
           $header .= &quot;MIME-Version: 1.0\r\n&quot;;
           $header .= &quot;Content-type: text/html\r\n&quot;;
           
           $retval = mail ($to,$subject,$message,$header);
           
          //  if( $retval == true ) {
          //     echo &quot;Message sent successfully...&quot;;
          //  }else {
          //     echo &quot;Message could not be sent...&quot;;
          //  }
        }catch(Exception $e){
            echo &quot;The error is &quot;.$e;
        }
        ?&gt;
        
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Can anyone help me with this</p>