title: Send mail through SMTP error in php
body: <p>I want to send mail with php my codes are these;</p>
  
  <pre><code>&lt;?php 
  include 'class.phpmailer.php';
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Host = 'smtp.gmail.com';
  $mail-&gt;Port = 587;
  $mail-&gt;Username = 'mertcankarayilan@gmail.com';
  $mail-&gt;Password = '*******';
  $mail-&gt;SetFrom($mail-&gt;Username, 'Pegasus Havayolları?');
  $mail-&gt;AddAddress('mertcankarayilan@hotmail.com', 'mertcankarayilan');
  $mail-&gt;CharSet = 'UTF-8';
  $mail-&gt;Subject = 'Ekomak';
  $content = 'mailde yazan';
  $mail-&gt;MsgHTML($content);
  if($mail-&gt;Send()) {
      echo "&lt;script&gt;window.location.href='islem-basari.php#gosterb';&lt;/script&gt;";
  } else {
      echo 'Mail gönderilirken bir hata oluştu: ' . $mail-&gt;ErrorInfo;
  }
  
  ?&gt;
  </code></pre>
  
  <p>and I see a error like this:</p>
  
  <p>The following From address failed: mertcankarayilan@gmail.com : MAIL not accepted from server</p>
  
  <blockquote>
    <p>SMTP server error: 5.7.0 Must issue a STARTTLS command first. k6sm56314517eep.17 - gsmtp</p>
  </blockquote>