mail() question
Posted: Tue Oct 21, 2003 8:42 pm
Hi all, I have the following code
...
$success = mail($emailaddy, $subject, $message, $headers);
if ($success)
echo "The email to $emailaddy from $from was successfully sent<p>";
else
echo "An error occurred when sending the email to $emailaddy from $from <p>";
I assume that is all correct, but when it is executed I get the error:
Warning: Failed to Connect in C:\blahblah\insertcal.php on line 36
An error occurred when sending the email to (sent email) from (from email)
I'm guessing the error is in that I don't have SMTP server set up correctly (i'm testing on my local machine atm). I have looked on the net for suggestions etc and haven't found much. I have to set up my php.ini file? Any suggestios on what I need to do to setup the SMTP properly (if that is indeed the problem) would be appreciated, thanks in advance.
...
$success = mail($emailaddy, $subject, $message, $headers);
if ($success)
echo "The email to $emailaddy from $from was successfully sent<p>";
else
echo "An error occurred when sending the email to $emailaddy from $from <p>";
I assume that is all correct, but when it is executed I get the error:
Warning: Failed to Connect in C:\blahblah\insertcal.php on line 36
An error occurred when sending the email to (sent email) from (from email)
I'm guessing the error is in that I don't have SMTP server set up correctly (i'm testing on my local machine atm). I have looked on the net for suggestions etc and haven't found much. I have to set up my php.ini file? Any suggestios on what I need to do to setup the SMTP properly (if that is indeed the problem) would be appreciated, thanks in advance.