-1

Following is the configuration in php.ini and sendmail.ini respectively :

[mail function]
sendmail_path = ""\"E:\Installed_Apps\xampp\sendmail\sendmail.exe\" -t""
mail.add_x_header = Off

[sendmail]
SMTP = localhost
smtp_port = 25
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=auto
error_logfile=error.log
auth_username=my_gmail_address
auth_password=my_xxxxxx
pop3_server=
pop3_username= 
pop3_password=
force_recipient=
hostname=

And I try to send email as :

<?php
$sent = mail('to_someone@hotmail.com','Message sent from XAMPP','Hey ! I just sent you a message using XAMPP');
if($sent) {
    echo "Mail sent successfully";
}else {
    echo "Sending failed";
}

I always get true for $sent but there is no email received at the above address. What could be the reason for this ? Is there anything wrong with the configuration file ?

Note : I uploaded php.ini and sendmail.ini @ github and I am running mercury on 25

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
  • Possible duplicate: http://stackoverflow.com/questions/13100659/no-mail-received-in-inbox-with-xampp-1-8-0-mercurymail-and-mail – Dave Mar 23 '13 at 03:53
  • Have you read the notes and comments on the documentation page? http://php.net/mail – Sverri M. Olsen Mar 23 '13 at 03:53
  • 2
    From [the manual](http://www.php.net/manual/en/function.mail.php) "It is important to note that just because the mail was accepted for delivery, **it does NOT mean the mail will actually reach the intended destination**. " – Celeritas Mar 23 '13 at 03:57
  • check whether smtp server runs as windows services – Tamil Selvan C Mar 23 '13 at 04:23

1 Answers1

1

You are actively setting it to use mailtodisk.exe which is a program that simply takes the e-mail and saves it to a folder - it never attempts to send the e-mail at all, it is simply a tool for checking that your e-mails look right.

From the docs regarding sendmail_path:

If set, smtp, smtp_port and sendmail_from are ignored and the specified command is executed.

Try commenting out sendmail_path and check that you have a SMTP server running on your computer on port 25.

Christian P.
  • 4,784
  • 7
  • 53
  • 70