Hi, I am trying to set up a simple form mail php script. I followed many tutorials and I prefer one that is very much like:
this
In short, it would be this code with a few minor modifications:
<?
$email = $REQUEST['email'] ;
$message = $REQUEST['message'] ;
mail( "yourname@example.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.example.com/thankyou.html" );
?>
I changed the header location for the thank you page to a real page, and changed the yourname@example.com to my email address, and the corresponding html form seems to be fine.
My problem comes when trying to actually send the email. The form is completed and submitted, but I never receive it. I do not get an error, only a blank page when I test it.
While I am only a noob, I suspect a problem with the SMTP server. Here is a snippet from my php.ini file:
[mail function]
; For Win32 only.
SMTP = 10.1.1.x
smtp_port = 25
; For Win32 only.
sendmail_from = richchristie@mysite.com
The default value for the SMTP = was localhost, but the server is a Windows 2003 Server running IIS 6. Our mail server is Groupwise 6.5 on Netware 6. The 10.1.1.x is the correct IP (x is replaced by a real #). I tried going with the default value and it didn't work, and I even tried using the server name and that still did not work. I have read:
http://www.php.net/manual/en/ref.mail.php
..but it did not really tell me anything that I understood that could help my problem. I've also performaned a forum search and found useful info, but nothing that helped.
Can anyone help me figure out why this simple comment form will not send email? PHP appears to be installed fine (test.php worked fine), and I've tried numerous sample and form mail scripts - all with the same result. I think the problem lies with PHP accessing SMTP, but that is just a guess.
Any help would be grealy appreciated.
Rich