Getting an error when testing mail function

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
ScottyC
Forum Newbie
Posts: 1
Joined: Tue Jan 29, 2008 1:55 pm

Getting an error when testing mail function

Post by ScottyC »

I am a newbie to php. I am trying to learn how to mail a form. I have set up the form and the appropriate php file and have saved them to my public folder on the local host.

I have set the mail function in the php.ini file, I have saved the changes and restarted the system. I have checked the php.info folder and the correct settings are saved in the .ini file

I am using a mail server with my website host, but am running the form on the local host.

my php.ini file reads
[mail function]
;for win32 only,
SMTP = auth.smtp.1and1.co.uk

; For win32 only.
sendmail_from = admin@c-it-group.com

my php file reads
<html>
<head>
<title>Sending mail from the feedback form</title>
</head>
<body>
<?php
echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo "<p>Your E-mail address is: <b>".$_POST["email"]."</b>.</p>";
echo "<p>Your Message was: <br />";
echo $_POST["message"]."</p>";
//start building the mail string
$msg = "Name: ".$_POST["name"]."\r\n";
$msg .= "E-mail: ".$_POST["email"]."\r\n";
$msg .= "Message: ".$_POST["message"]."\r\n";
// set up the mail
$recipient = "admin@c-it-group.com";
$subject = "Form Submission Results";
$mailheaders = "From: <admin@c-it-group.com>\r\n";
$mailheaders .="Reply to: ".$_POST["email"];
// send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>


the error message I get is:
Warning: Failed to Receive in c:\phpdev\www\public\sendmail.php on line 21

Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpdev\www\public\sendmail.php on line 24

Any ideas what I am doing wrong? I have checked my mail server with outlook express & everthing is working fine. Please help
Post Reply