1

I'm trying send to a gmail, using xampp.

my PHP version is 5.6.8

Using this source as a guide, I changed the config of my php.ini and sendmail.ini But it didn't work for me. The page always display Failure: Email was not sent!

This is my php:

$to      = '[email protected]';
$subject = 'No subject';
$message = 'Hello, this is the content of the email.';
$headers = 'From: [email protected]';

if(mail($to, $subject, $message, $headers)) {
    echo 'Email sent successfully!';
} else {
    die('Failure: Email was not sent!');
}

These are the things that I changed in my php.ini:

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

sendmail.ini:

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=**********
[email protected]
2
  • Do you have a SMTP server in your local host?? Commented Sep 19, 2015 at 18:46
  • And did you download glob.com.au/sendmail ?? Commented Sep 19, 2015 at 18:48

1 Answer 1

1

Looks like you tried well but that post doesn't contain like of an author. please look into this link.this might help you.

Sign up to request clarification or add additional context in comments.

2 Comments

What is this URL you put?? Error 404.. @rajesh
Ohh sorry my mistake .. Click here for correct version stackoverflow.com/questions/19132171/…

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.