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.
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 = 'nikamanish007@gmail.com';
$subject = 'php mail';
$message = 'hello';
$headers = 'from manish';
if(mail($to, $subject, $message, $headers))
{
echo 'mail sent';
}
else
{
echo 'mail not sent';
}
?>
You need to enable Allow less secure apps: ON in your gmail account.