title: PHP Mailer - SMTP GMAIL AUTHENTICATION
body: <p>I have problem with the PHP MAILER function. I am using GMAIL SMTP Authentication for sending email and also its working perfectly but i want to set "From" email like "myid@domainname.com" but it doesn't working properly.</p>
  
  <p>I used below code to set "From" email</p>
  
  <pre><code>$mail             = new PHPMailer();
  
  $mail-&gt;IsSMTP(); // telling the class to use SMTP
  $mail-&gt;Host       = "mail.gmail.com"; // SMTP server
  $mail-&gt;SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
  $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
  $mail-&gt;SMTPSecure = "ssl";                 // sets the prefix to the servier
  $mail-&gt;Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
  $mail-&gt;Port       = 465;                   // set the SMTP port for the GMAIL server
  $mail-&gt;Username   = "test@gmail.com";  // GMAIL username
  $mail-&gt;Password   = "test@123";  
  
  $mail-&gt;SetFrom("myid@domainname.com","Domian");
  </code></pre>
  
  <p>It's showing me default email test@gmail.com instead of myid@domainname.com</p>
  
  <p>Please help me out.</p>
  
  <p>Thanks in Advance!</p>