2

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?

2
  • php mail setup in xampp Commented Jul 21, 2014 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. Commented Jul 21, 2014 at 14:10

1 Answer 1

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 = [email protected]
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
[email protected]
auth_password=my-gmail-password
[email protected]
Sign up to request clarification or add additional context in comments.

1 Comment

I don't want to use Gmail or other, I would to use the native mail() function, without using any real email address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.