do you have sendmail or smtp configured properly. Yao should test that first. Try to put instad of SMTP=localhost name of some other server, taht you can connect and send mail from.
----- Original Message ----- From: Anthony Ritter <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 19. studeni 2001 01:07 Subject: [PHP] PHP mail() function. Help please... > I'm reading J.Meloni's tutorial on page 119 in "Fast and Easy" and she is > explaining using the PHP mail function. > > There are two scripts for this example... > > One is the .html file which lays out the form with input boxes, a textarea > box and a submit button. > > It is: > > <HTML> > <HEAD> > <TITLE> Simple Feedback Form </TITLE> > </HEAD> > <BODY> > <FORM METHOD="post" ACTION="send_simpleform.php"> > <P> <strong> Your name: </strong> <br> > <INPUT TYPE="text" NAME="sender_name" SIZE=30></P> > <P> <strong> Your e-mail address: </strong> <br> > <INPUT TYPE="text" NAME="sender_email" SIZE=30></P> > <P> <strong> Your message: </strong> <br> > <TEXTAREA NAME ="message" COLS=30 ROWS=5 WRAP=virtual></TEXTAREA></P> > <P> <INPUT TYPE="submit" NAME= "submit" VALUE="Send this form"> </P> > </FORM> > </BODY> > </HTML> > ........................................................ > > The next is the PHP script which reads as follows: > > <? > $msg="This e-mail is being sent from www site\n"; > $msg.="Sender's name: \t$sender_name\n"; > $msg.="Sender's e-mail:\t$sender_email\n"; > $msg.="Message:\t$message\n\n"; > $to="[EMAIL PROTECTED]"; > $subject="Website Feedback"; > $mailheaders="From: My website<> \n"; > $mailheaders.="Reply to: $sender_email\n\n"; > mail($to,$subject,$msg,$mailheaders); > ?> > <HTML> > <HEAD> > <TITLE>Simple Feedback Form</TITLE> > </HEAD> > <BODY> > <H1>The following e-mail has been sent:</H1> > <P><strong>Your Name:</strong><br> > <?echo "$sender_name";?> > <P><strong>Your email address:</strong><br> > <?echo "$sender_email";?> > <P><strong>Message:</strong><br> > <? echo "$message"; ?> > </BODY> > </HTML> > .............................................. > > Everytime I input a name, e-mail, and test blurb for the message box form > and hit submit, I get: > > Warning: Failed to connect in C:\Program Files\Apache > Group\Apache\htdocs\send_simpleform.php > in line 10. > > I have made the corrections in my php.ini file in the [mail function] > to read as follows: > > SMTP=localhost > [EMAIL PROTECTED] > > Please advise if anyone knows what I am doing wrong. > > Thanking all in advance. > Tony Ritter > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]