nikamanish
nikamanish

Reputation: 772

Google preventing login from XAMPP server

I am trying to add a confirm email address feature to my web app. I configured the XAMPP server and changed all the required lines in php.ini and sendmail.ini But when I tried to send a mail, I got the following message from Google.

Screenshot of the mail

Can this be fixed?

I used the following link to configure

How to configure XAMPP to send mail from localhost?

The following is the code to send mail.

<?php
$to      = '[email protected]';
$subject = 'php mail';
$message = 'hello';
$headers = 'from manish';

if(mail($to, $subject, $message, $headers))
{
    echo 'mail sent';
}
else
{
    echo 'mail not sent';
}
?>

Upvotes: 0

Views: 732

Answers (1)

Rameshkumar Veldurai
Rameshkumar Veldurai

Reputation: 56

You need to enable Allow less secure apps: ON in your gmail account.

  1. Go to Gmail account security
  2. Click on Sign-in & Security
  3. Scroll down, there will be an option "Allow less secure apps" which is set to OFF by default, just turn on the setting and check.

Upvotes: 4

Related Questions