-1

I am trying to send mail from localhost.

I changed files php.ini and sendmail.ini and still not working. I am also turned on "Less secure app access" in Gmail account security

php.ini

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-email@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header=Off

sendmail.ini

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-email@gmail.com
auth_password=my-email-password
force_sender=my-email@gmail.com

Mayank Patel
  • 3,868
  • 10
  • 36
  • 59
Mix
  • 9
  • 3
  • 1
    "still not working" - what isn't working exactly? Are you seeing an error message? – avojak May 02 '19 at 19:50
  • Don’t tag your questions with unrelated tags like PHPMailer and phpmyadmin. – Synchro May 02 '19 at 19:58
  • Possible duplicate of [Send email from localhost running XAMMP in PHP using GMAIL mail server](https://stackoverflow.com/questions/19132171/send-email-from-localhost-running-xammp-in-php-using-gmail-mail-server) – miken32 May 02 '19 at 21:12

1 Answers1

2

You also need to allow less secure apps from your google account.

  1. Go to your Google Account.
  2. On the left navigation panel, click Security.
  3. On the bottom of the page, in the Less secure app access panel, click Turn on access.

https://support.google.com/accounts/answer/6010255?hl=en

Astrea
  • 148
  • 9