mail() function with PHP

Discovermypath

New Member
Hello all,

I have set up a local server (Apache) on my computer to test out PHP and MySQL. I installed Apache, PHP, MySQL and phpmyadmin all individually following a lynda.com tutorial that was very helpful to follow.

The problem is that I can't get the mail() to work and email me things from a contact form or whatever that I have set up. My code is all correct so their is no problems there.

I have looked over a few forums on this subject but still haven't gotten anything to work. I have a gmail account that I want to have these practice emails sent to.

Does anyone know of a fix for this. Right now I'm just going under the assumption that the mail() will work when I actually get a site on the web, but it would be nice to see everything work while I'm testing it out.

Thanks for any advice in advance!!!
 

Edge

Member
In php.ini you need:

SMTP = your.isp.mailserver.address

sendmail_from = your.email.address
 

chrishirst

Well-Known Member
Staff member
The problem is that I can't get the mail() to work and email me things from a contact form or whatever that I have set up. My code is all correct so their is no problems there.

Just for anyone reading this in the future, and no-one has explained why as yet.

It's because you don't have a mail server set up on your PC.
 
Top