title: Your domain gmail.com is not allowed in header From
body: <p>1 month before this code is working fine on website which hosting is provided by "godaddy" now hosting is renew by different server "namecheap" after renewing domain this error is occur during sending mail.
  I updated PHPMailer file but nothing happen.</p>
  
  <p>An uncaught Exception was encountered
  Type: phpmailerException</p>
  
  <p>Message: SMTP Error: The following recipients failed: abc@gmail.com: "Your IP: <strong><em>.</strong>.<strong></em>.</strong> : Your domain gmail.com is not allowed in header From"</p>
  
  <p>Filename: /Directory_path/phpmailer/class.phpmailer.php</p>
  
  <p>Line Number: 1585</p>
  
  <p>Backtrace:</p>
  
  <p>File: /Directory_path/phpmailer/class.phpmailer.php
  Line: 1337
  Function: smtpSend</p>
  
  <p>File: /home/Directory_path/phpmailer/class.phpmailer.php
  Line: 1215
  Function: postSend</p>
  
  <p>File: /Directory_path/views/contact.php
  Line: 34
  Function: send</p>
  
  <p>File: /Directory_path/controllers/Contact.php
  Line: 7
  Function: view</p>
  
  <pre><code>$name= $_POST["name"];
  $email = $_POST["email"];
  $msg = $_POST["msg"];
  require "phpmailer/PHPMailerAutoload.php";
  $mail = new PHPMailer(true);
  $mail-&gt;isSMTP();
  $mail-&gt;Host = "mail.domain_name.com";
  $mail-&gt;port = 465;
  $mail-&gt;SMTPAuth=true;
  $mail-&gt;SMTPSecure = 'tls';
  $mail-&gt;Username = "info@example.com";
  $mail-&gt;Password = '********';
  $file_name = $_FILES["attc"]["name"];
  $tmp_name = $_FILES["attc"]["tmp_name"];
  $path = $_SERVER['DOCUMENT_ROOT'].'/application/views/upload_images/';
  move_uploaded_file($tmp_name, $path.$file_name);
  $mail-&gt;setFrom($email, $name);
  $mail-&gt;addAddress('abc@gmail.com','Mail Header');
  $mail-&gt;addReplyTo($email, $name);
  $mail-&gt;isHTML(true);
  if($file_name != '' &amp;&amp; $file_name != null){
  $mail-&gt;AddAttachment($_SERVER['DOCUMENT_ROOT']."/application/views/upload_images/".$file_name,$file_name);
  }
  $mail-&gt;Subject = "Info From Web";
  $mail-&gt;Body = '&lt;strong&gt;' .$msg . '&lt;/strong&gt;&lt;br&gt;&lt;br&gt;&lt;h3&gt;Regard :  '.$name.'&lt;/h3&gt;';
  if ($mail-&gt;send()) {
      echo "&lt;script&gt;alert('Email Sent Success!')&lt;/script&gt;";
  }
  else{
      echo "&lt;script&gt;alert('".$mail-&gt;ErrorInfo."')&lt;/script&gt;";
  }
  </code></pre>