1

I need to send emails from localhost from a XAMPP installation. I don't want to use Sendmail with a Gmail as many tutorials show.

There is any way to do work PHP mail() function on localhost?

Federico Liva
  • 418
  • 1
  • 6
  • 19
  • [php mail setup in xampp](http://stackoverflow.com/a/4653086/3770448) – ljacqu Jul 21 '14 at 14:05
  • Even if you do not want Gmail, you will need a working SMTP server anyway. You have to either rent one, or setup your own on a VPS. – Salman Jul 21 '14 at 14:10

1 Answers1

1

if your configure like this C:\xampp\php\php.ini and c:\xampp\sendmail\sendmail.ini for gmail to send mail. now in C:\xampp\php\php.ini find out extension=php_openssl.dll and remove the semicolon from the beginning of that line to make SSL working for gmail for localhost.

file find [mail function] in php.ini and change

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

and open it C:\xampp\sendmail\sendmail.ini. Replace all the existing code in sendmail.ini with bellow code

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com
Ferrakkem Bhuiyan
  • 2,741
  • 2
  • 22
  • 38