Thread: PHP email form won't work
07-15-2007, 04:39 PM #1
PHP email form won't work
- Member Since
- Jul 15, 2007
- Banbury, Oxfordshire
- MacMini pre Intel :(
I am a relatively new web developer and have set up my macmini to run a stand alone coldfusion server and also a PHP/MySQL testing site. I've been using PHP ultimately because I couldn't get coldfusion to recognise any sql datacases. Anyway I've got the part in my book where I send an email from a form and it went through the parts of the script below:
$to = "firstname.lastname@example.org";
$subject = "This is the message body";
$body = "This is the message subject";
$headers = "From: email@example.com\n";
So with this entered when the page loads it should send an email to the email address I enter, unfortunately it didn't. I used the completed file they send for you to refer to if you get stuck and that didn't work either. There were comments saying firewalls or your isp may block it etc so I thought I'd test it with coldfusion and it worked, removing that theory.
After a lot of googling and playing around with sendmail and postfix (sendmail would not start?, so have used postfix) I have managed to send an email from Mail using localhost as the SMTP. In php.ini I have set the sendmail_path to = /usr/sbin/postfix and checked that php recognises this path using phpinfo. I have therefore concluded that php recognises postfix and postfix can send mail so when I go back to the original point and load the page with the php script it should work - It didn't!!
How do I get php to recognise postfix or an SMTP setting that I can use for testing php scripts with? I also set a relayhost=smtp.server.com in the main.c file of postfix but this didn't make a difference.
Having spent my weekend dispairing over this I decided to tackle the original problem I had with coldfusion, causing me to learn php instead of coldfusion, and have solved that problem so if I get no solution to this I will start the book again using coldfusion tags!
Any advice gratefully received.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By meals63 in forum OS X - Operating SystemReplies: 0Last Post: 09-05-2012, 01:10 PM
By Cryo in forum OS X - Operating SystemReplies: 1Last Post: 10-15-2011, 03:01 AM
By r.mistry6 in forum Web Design and HostingReplies: 2Last Post: 07-13-2009, 08:06 PM
By reholmes in forum OS X - Development and DarwinReplies: 0Last Post: 07-16-2007, 05:13 AM
By neen273 in forum OS X - Operating SystemReplies: 7Last Post: 09-20-2006, 03:14 AM