I have an HTML page that has a form on it and a Submit button that brings up the following script located in a different php file:
<?php
$txt = "First line of text\nSecond line of text";
// Use wordwrap() if lines are longer than 70 characters
$txt = wordwrap($txt,70);
// Send email
mail("xxx@xxx.xxx","My subject",$txt);
echo "done";
?>
I do not get an error message, however I do not get the e-mail to send, either. I originally had a much more complicated script which passed variables from the HTML page to the PHP script, but have simplified things by copying a script I found on the Internet to get the e-mail to send then then I will build on it from there. I know that I have spelled the php file name correctly in the html file for the form action statement because I do get the "done" statement to print in the echo command.
I am building this feature on a laptop that runs Windows XP, IIS, Outlook Express and Outlook. My questions are as follows:
Can I get this function to work with my configuration of do I need another SMTP program. I have researched this all day and it seems like I need a sendmail utility. I have updated my PHP.ini file with the following parameters:
SMTP =localhost
smtp_port=25
In short, I need to know if the mail() function will work on my laptop with a standard XP OS, IIS and using Outlook or Outlook Express. If it will work, what do I need to do, load or buy to make it happen.
Thanks in advance for your help.
Bob