phpanon Posted March 20, 2008 Share Posted March 20, 2008 Hi everyone, <?php require "connect.php"; require "EmailConnect.php"; $roomID = $_POST['roomID']; $bkgDate = $_POST['bkgDate']; $bkgTime = $_POST['bkgTime']; $empID = $_POST['empID']; if($roomID == "[select Room Number]") { $message2 = "Please select a Room Number"; header("Location: MeetingMain.php?message2=$message2"); exit(); } if($bkgTime == "[select Time]") { $message3 = "Please select a Meeting Time"; header("Location: MeetingMain.php?message3=$message3"); exit(); } else if($building == !null || $roomID == !null) { $query = "SELECT COUNT(*) FROM booking WHERE bkgTime ='".$bkgTime."' AND bkgDate ='".$bkgDate."' AND roomID ='".$roomID."'"; $result = mysql_query($query, $connection) or die ("Unable to perform query<br>$query"); $row= mysql_fetch_row($result); $count = $row[0]; if($count) { $message5 = "Sorry Meeting Room is booked on that date at that time. Please re-select."; header("Location: MeetingMain.php?message5=$message5"); exit(); } else { $to = '[email protected]'; $subject = "Room ".$roomID." Successfully Booked"; $message = "You have successfully booked a Meeting Room. \n \n Meeting Room : ".$roomID." \n Date: ".$bkgDate." \n Time Slot: ".$bkgTime.". \n \n This is a confirmation email. Do not reply. \n \n \n \n RIAS Plc \n Insurance for the over 50's."; $headers = 'From: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); $query2 = "insert into booking values ('','".$roomID."','".$empID."','".$bkgDate."','".$bkgTime."')"; $result2 = mysql_query($query2, $connection) or die ("Unable to perform query<br>$query2"); $message4 = "Meeting Room Booked "; header("Location: MeetingMain.php?message4=$message4"); exit(); } } ?> Can anybody help me so that rather than the page crashing if it cant connect to the mail server the page just carries on and runs the sql query without sending the email. Link to comment https://forums.phpfreaks.com/topic/97150-email-server-connection-error/ Share on other sites More sharing options...
phpanon Posted March 21, 2008 Author Share Posted March 21, 2008 any ideas anyone?? :-\ please Link to comment https://forums.phpfreaks.com/topic/97150-email-server-connection-error/#findComment-497248 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.