7 Years
Discussion Span
Last Post by Muhsin Mohamed
Featured Replies
  • 1
    diafol 3,720   7 Years Ago

    [QUOTE=;][/QUOTE] You need to set up your local machine to do that (SMTP). Mercury Mail will allow you to do this. It should be included in the full xampp download for windows. Read More


You need to set up your local machine to do that (SMTP). Mercury Mail will allow you to do this. It should be included in the full xampp download for windows.


hi. here is my tested solution.

you only have to modify 2 ini files: php.ini and sendmail.ini

1)look for mail function in php.ini(c:/xampp/php/php.ini)>>[mail function]

change the following::



sendmail_from = from@gmail.com

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

NOTE: ensure that the path you specify for sendmail_oath is valid.In my case it is in C.
SAVE your changes.

2) next modify sendmail.ini(c:/xampp/sendmail/sendmail.ini)
comment the mercury as shown below

# Mercury
#account Mercury
#host localhost
#from postmaster@localhost
#auth off

# A freemail service example
#account Hotmail
#tls on
#tls_certcheck off
#host smtp.live.com
#from [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]

then paste the following lines:

account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from x@gmail.com
auth on
user x@gmail.com
password x

port 587

# Set a default account
account default : Gmail

Again SAVE your changes.

Use the code below to test if it's working!
$subject="Test mail";
$body="This is a test mail";
if (mail($to,$subject,$body))
echo "Mail sent successfully!";
echo"Mail not sent!";

NOTE in the above configuration the sender should use gmail email service,for the recipient any email service will do.

Edited by novice02: n/a


Hi there mr. novice02!

i followed and tested your post just now, im just confused about the section #2 you specified there, it looks so different in my sendmail.ini file, here are the contents of my sendmail.ini file:

; configuration for fake sendmail

; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail


; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.


; smtp port (normally 25)


; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify


; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging


; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging


; if your smtp server requires authentication, modify the following two lines


; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines


; to force the sender to always be the following email address, uncomment and
; populate with a valid email address. this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content


; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required


so far im user xampp v1.7.7, ive been struggling with this problem for the past 4hours and have been unlucky to find any solutions so I decided to search out the net...


I usually blast necroposting, but in this case - nice link :)


I have tried setting up the mail server xampp then tested but getting no error and no email being sent either !!! please help. I can post php.ini and sendmail.ini if required.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.