0

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';
}
didi B
  • 19
  • 1
  • Did you follow [these steps](https://i.stack.imgur.com/MOFCH.png) from [the BadCredentials link](https://support.google.com/mail/?p=BadCredentials)? – Adelin Jun 15 '18 at 08:31
  • Specifically https://support.google.com/accounts/answer/185833 ? – mario Jun 15 '18 at 08:59
  • Yes, I am trying to get my app password but I receive the message " The setting you are looking for is not available for your account." I do not know what to do next – didi B Jun 15 '18 at 16:27
  • Now it seems to magically work? My credentials in php.ini and sendmail.ini were correct and all I did was change again my password to my gmail account with the same pass. It worked but left me really confused – didi B Jun 15 '18 at 16:31

0 Answers0