title: PHP mailer error
body: <p>I tried to use php mailer but errors as follows.</p>
  
  <pre><code>SMTP -&gt; FROM SERVER:
  SMTP -&gt; FROM SERVER:
  SMTP -&gt; ERROR: EHLO not accepted from server:
  SMTP -&gt; FROM SERVER:
  SMTP -&gt; ERROR: HELO not accepted from server:
  SMTP -&gt; ERROR: AUTH not accepted from server:
  SMTP -&gt; NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate. Message could not be sent.
  
  Mailer Error: SMTP Error: Could not authenticate. 
  </code></pre>
  
  <p>and my code </p>
  
  <pre><code> &lt;?php
          require("class.phpmailer.php")
          $mail = new PHPMailer();        
          $mail-&gt;IsSMTP();                                    
          $mail-&gt;Host = "smtp.gmail.com";  
          $mail-&gt;Port = 465;        
          $mail-&gt;SMTPAuth = true;     
  
          $mail-&gt;SMTPDebug = 2;  
          $mail-&gt;Username = "admin@xxxxxxxxxxxx.in";  
          $mail-&gt;Password = "xxxxxxxx";   
          $mail-&gt;From = "admin@xxxxxxxxxxxx.in";
          $mail-&gt;FromName = "Mailer";
          $mail-&gt;AddAddress("xxxx@yahoo.co.in", "mine");               
          $mail-&gt;WordWrap = 50;                                 
          $mail-&gt;IsHTML(true);                                  
  
          $mail-&gt;Subject = "Here is the subject"  
          $mail-&gt;Body    = "This is the HTML message body &lt;b&gt;in bold!&lt;/b&gt;";
          $mail-&gt;AltBody = "This is the body in plain text for non-HTML mail clients";
  
  
          if(!$mail-&gt;Send())  {
             echo "Message could not be sent. &lt;p&gt;";
             echo "Mailer Error: " . $mail-&gt;ErrorInfo;
             exit;
          }
          echo "Message has been sent";
  
          ?&gt;
  </code></pre>