title: phpmailer on windows IIS
body: <p>I am trying to configure PHPMailer in order to have it working ona Windows IIS server using php scripts.</p>
  
  <p>The application I have is written in PHP so we expected we could easily use PHPMailer to send emails.</p>
  
  <p>Well, that doesn't work.</p>
  
  <p>We have tried configuring it as SMTP, but we still get error in configuration.</p>
  
  <p>Here it is our script:</p>
  
  <pre><code>date_default_timezone_set('Etc/UTC');
  $mail = new PHPMailer;
  $mail-&gt;isSMTP();
  $mail-&gt;SMTPDebug = 1;
  //$mail-&gt;Debugoutput = 'html';
  $mail-&gt;Host = 'smtp.gmail.com';
  $mail-&gt;Port = 587;
  $mail-&gt;SMTPSecure = 'tls';
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Username = "account@gmail.com";
  $mail-&gt;Password = "gmailPWD";
  $mail-&gt;setFrom('info@website.com', 'The Website');
  
  $mail-&gt;addAddress($to, '');     
  $mail-&gt;Subject = $subject;
  $mail-&gt;msgHTML($message);
  
  
  if (!$mail-&gt;send()) {
      $errors =  "Errori Mailer: " . $mail-&gt;ErrorInfo;
  } else {
      $errors =  "&lt;h5&gt;Sent!&lt;/h5&gt;";
  }
  </code></pre>
  
  <p>Any clue? How can that be used on windows server?</p>
  
  <p>Thank you</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>So, it was a problem of Gmail and its security settings. I followed this post: <a href="https://stackoverflow.com/a/25175234/1873501">https://stackoverflow.com/a/25175234/1873501</a> and everything went smooth!</p>
  
  <p>I just wanted to share it.</p>