[thelist] [fwd] probelm with the "mail" function etc
Garry Charles
grc-the-master at brain-cpu.freeserve.co.uk
Mon Apr 23 17:16:38 CDT 2001
---------------------------------------------
This message was held by thelist software and
is being manually forwarded by a list admin.
Please remember to send emails in plain-text
format only, or they will not reach thelist
until it is later forwarded by a list admin.
---------------------------------------------
Would someone be good enough to help me please, as I can not work out =
what is going on !
I'm trying to get a email form script working
Right, I'm running (on my computer) Apache web server, php4 and mysql =
etc.=20
For the 'mail' function to work properly my literature says the =
following
1) find the '[mail function]' section in your php.ini=20
2) modify the 'SMTP' and 'sendmail_from' lines in this section so that =
they
contain 'localhost' and (say) your email address respectively
I've done that !
-------------------------------------------------------------------------=
----------------------------------
Now, I've prepared the following htm file....
-------------------------------------------------------------------------=
----------------------------------
<html>
<head></head>
<body>
<form method=3D"post" action=3D"eform.php">
Your name :<input type=3D"text" name=3D"username" size=3D50><br>
Your email:<input type=3D"text" name=3D"useremail" size=3D50><br>
<textarea name=3D"usermessage" rows=3D5 cols=3D50></textarea><br>
<input type=3D"submit" name=3D"submit" value=3D"send form">
</form>
</body>
</html>
-------------------------------------------------------------------------=
----------------------------------
and here's my relevant php file....
-------------------------------------------------------------------------=
----------------------------------
<?php
$msg.=3D"e-mail sent from";
$msg.=3D"sender's name :\t$username\n";
$msg.=3D"sender's email :\t$useremail\n";
$msg.=3D"message :\t$usermessage";
$to=3D"grc-the-master at brain-cpu.freeserve.co.uk";
$subject=3D"test email entry";
$mailheaders=3D"from: my web site ";
$mailheaders.=3D" reply to: $useremail\n\n";
mail($to,$subject,$msg,$mailheaders);
?>
<html>
<head>
</head>
<body>
<p> the following email has been sent...</p>
<?php
echo "Your name - $username<br>";
echo "Your email - $useremail<br>";
echo "Your message - $usermessage<br>";
?>
</body>
</html>
Now then, the htm file correctly passes the information over to the php =
file, the php file
correctly displays the email information .......GREAT !!..... but =
hold on, there's an=20
error message which I do not understand
the error message being displayed (php file on screen) is
Warning: Failed to Connect in c:\program files\apache =
group\apache\htdocs\eform.php on line 12
(it's something to do with the 'mail' function line ...but what? )
TIA
Gaz
More information about the thelist
mailing list