title: Email Attempt Failed when signin through PHP in gmail
body: <p>I need a help in email sending in PHP. Am actually trying to send email using PHP mailer. Somehow for some of the mail ids am able to send the email but for some other email ids am unable to send. I receive an email in gmail stating 'Signin attempt prevented.' Can somebody help me know where do I need to change the settings in my gmail account in order to make my PHP code to send emails?</p>
  
  <pre><code>require("phpmailer/class.PHPMailer.php");
  require("phpmailer/class.smtp.php");
  $f_pointer=fopen("test.csv","r"); // file pointer
  $emails = array();
  while (($data = fgetcsv($f_pointer, 1000, ",")) !== FALSE) {
      $num = count($data);
      $emails[] = $data[1];
  }
  foreach($emails as $key=&gt;$val){
      $mail = new PHPMailer();
  
      $mail-&gt;IsSMTP();                          // set mailer to use SMTP
      $mail-&gt;Host = "tls://smtp.gmail.com:587";  // specify main and backup server
      $mail-&gt;SMTPAuth = true;     // turn on SMTP authentication
      $mail-&gt;Username = "abc";  // SMTP username
      $mail-&gt;Password = "some password"; // SMTP password
  
      $mail-&gt;From = "abc@gmail.com";
      $mail-&gt;FromName = "abc";
      $mail-&gt;AddAddress($val);
  
      $mail-&gt;Subject = "Here is the subject";
      $mail-&gt;Body    = "This is the HTML message body &lt;b&gt;in bold!&lt;/b&gt;";
      $mail-&gt;AltBody = "This is the body in plain text for non-HTML mail clients";                     
  
      if(!$mail-&gt;Send())
      {
          echo "Message could not be sent. &lt;p&gt;";
          echo "Mailer Error: " . $mail-&gt;ErrorInfo;
          exit;
      }
  
      echo "Message has been sent";
  }
  </code></pre>
  
  <p>This is working fine for some example 'abc@gmail.com', but when I use other username, password and email say 'xyz@gmail.com' I receive an email in my inbox stating 'signin attempt failed.' Help appreciated. </p>