I am sorry if this is a duplicate question, but I would like some suggestions. I am a beginner at php and I have xampp on my own laptop. I used these configurations in the first comment here replacing the email address and pasword with my own: How to configure XAMPP to send mail from localhost? In my sendmail folder in error.log I get this "18.06.15 11:19:00 : Username and Password not accepted. Learn more at https://support.google.com/mail/?p=BadCredentials y30-v6sm1485992wrd.70 - gsmtp". I checked again my password and email adress in php.ini and they are correct. My testing email php code is:
$to = 'valid_address@gmail.com';
$subject = 'Success';
$body = 'Hello World';
$headers = 'From no-reply@app.com';
if(mail($to, $subject, $body, $headers)){
echo 'email sent '.$to;
} else {
echo 'error';
}