title: PHPMailer - Mail not accepted from server Error
body: <p>I searched web for this issue but none of them solve my problem. I am trying to send single mail using PHPMailer. But I am getting this error in my browser screen.</p>
  
  <pre><code>SMTP -&gt; FROM SERVER: 
  SMTP -&gt; ERROR: RSET failed: 
  SMTP -&gt; FROM SERVER: 
  SMTP -&gt; ERROR: MAIL not accepted from server: 
  The following From address failed: mymailid@gmail.com : MAIL not accepted from server,,
  SMTP server error:
  
  Mailer Error: The following From address failed: mymailid@gmail.com : MAIL not accepted from server
  </code></pre>
  
  <p>My code to send mail is.</p>
  
  <pre><code>&lt;?php 
      require_once('mailer/class.phpmailer.php');
      date_default_timezone_set('Asia/Kolkata');
  
      $to = $_POST['to'];
      $subject = $_POST['subject'];
      $msg = $_POST['msg'];
  
      $mail = new PHPMailer();
      $mail -&gt; SMTPDebug = 2;
      $mail -&gt; IsSMTP();
      $mail -&gt; SMTPSecure = 'tls';
      $mail -&gt; Host = 'smtp.gmail.com';
      $mail -&gt; Port = 587;
      $mail -&gt; SMTPAuth = true;
  
      $mail -&gt; Username = 'mymailid@gmail.com';
      $mail -&gt; Password = '*********';
  
      $mail -&gt; setFrom("mymailid@gmail.com","Name");
      $mail -&gt; addReplyTo("mymailid@gmail.com","Name");
      $mail -&gt; Subject = $subject;
      $mail -&gt; msgHTML($msg);
      $mail -&gt; addAddress($to);
  
      if(!$mail -&gt; send()) {
          echo "&lt;h3&gt;Mailer Error: ". $mail-&gt; ErrorInfo . "&lt;/h3&gt;";
      }
      else {
          echo "&lt;h1&gt;Email Sent Successfully.&lt;/h1&gt;";
      }
  
  ?&gt;
  </code></pre>
  
  <p>Please help me to solve this problem. Thanks in advance.</p>