php - Can't send mail from localhost/xampp -


failed connect mailserver @ "mail.google.com" port 587, verify "smtp" , "smtp_port" setting in php.ini or use ini_set()

i configured xampp php.ini , sendmail.ini file use gmail account sending email php script. using xampp. after changing [mail function] part of php.ini looks (i have deleted commented outlines simplicity)

[mail function] smtp = mail.google.com smtp_port = 587 mail.add_x_header = off 

and sendmail.ini file looks this

[sendmail] smtp_server=mail.google.com smtp_port=587 smtp_ssl=auto error_logfile=error.log auth_username=babar+gmail.com auth_password=********** 

so have missed? why getting error?

you using wrong smtp settings gmail. correct ones are:

in php.ini

[mail function] ;smtp = localhost ;sendmail_from = me@example.com sendmail_path = "c:\sendmail\sendmail.exe -t -i" 

in sendmail.ini

[sendmail] smtp_server=smtp.gmail.com smtp_port=587 smtp_ssl=tls auth_username=me@example.com auth_password=********** 

remeber: if have enabled 2 step authentication, have create application specific password.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -