title: XAMPP Sendmail using Gmail account
body: <p>I'm trying to configure Sendmail through XAMPP to send email. In my sendmail.ini I have these settings:</p>
  
  <pre><code># Set default values for all following accounts.
  
  logfile "C:\xampp\sendmail\sendmail.log
  account Gmail
  tls on
  port 587
  tls_certcheck off
  host smtp.gmail.com
  from myemail@gmail.com
  auth on
  user myemail06@gmail.com
  password mypassword
  
  account default : Gmail
  </code></pre>
  
  <p>I've created a test script like this:</p>
  
  <pre><code>$to = "testemail@btinternet.com";
  $subject = "Hi!";
  $body = "Hi,\n\nHow are you?";
  $headers = "From: myemail06@gmail.com" . "\r\n";
  if (mail($to, $subject, $body, $headers)) {
      echo ("Message successfully sent!");
  } else {
      echo ("Message delivery failed...");
  }
  </code></pre>
  
  <p>I get a message to say that the email was sent but it never arrives and in the logs I get:</p>
  
  <p>sendmail: Error during delivery: Must issue a STARTTLS command first.</p>
  
  <p>Does anybody know what the issue could be here?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Gaz</p>