DEV Community

SKDDEV
SKDDEV

Posted on

Send mail with php on localhost

dev environnment

PHP 7.2.11
Laragon

Hello Guys,

please, help me,
I am developing a website using PHP. i want to send (email on localhost to my gmail account.

here are my sendmail.ini file config

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=auto
error_logfile=error.log
debug_logfile=debug.log
auth_username=account@gmail.com
auth_password=*************
force_sender=account@gmail.com

And i set the sendmail path in php.ini file

Also i disable two factors authentication and enable Less secure application access in my gmail account setting

So

when i send the email, it worked and i receive it in format text in the output directory localized in C:\laragon\bin\sendmail\output but not in my gmail account inbox

Here is the error that i get in error.log file (19/06/12 15:50:53 : Must issue a STARTTLS command first. r3sm21418441wrr.61 - gsmtp)

Top comments (1)

Collapse
 
full_stackgeek profile image
Full Stack Geek

Hey,
You can check here:
stackoverflow.com/a/10509882/9138047