I tried real hard to practice that elusive php mail function but i couldn't manage to successfully send email from my php form to any of the mailbox addresses that i specified as recipient in my php form. It has been three days and i am still clueless. So all that can really help me now is a clear understanding of what actually happens when we trigger the mail function right from our form through the smtp server to the target mailbox.I am using xampp with mercury mail.

When you invoke the mail() function, it tries to connect to the smtp server, as specified in the php.ini

I don't know where you are trying to connect to, but not all mail servers allow this. If you are trying to connect to localhost, then you need a local smtp server, which I doubt is installed.

This article has been dead for over six months. Start a new discussion instead.