tulleh Posted April 16, 2006 Share Posted April 16, 2006 Can someone help me check my mail function? It suddenly stopped working, it gives me a SENT page, but the e-mail is never received.[code]mail($mailto, $subject, $messageproper, "From:" . "$name <$email>\r\nReply-To: $name <$email>");[/code]That's my main mail coding, if you need the entire script, just say so please. Thanks :) Quote Link to comment https://forums.phpfreaks.com/topic/7538-php-mail-error/ Share on other sites More sharing options...
AndyB Posted April 16, 2006 Share Posted April 16, 2006 If it used to work perfectly and then stopped working AND you didn't make any changes to it, then possibly your host upgraded php to a version where register_globals is OFF and your code assumed it was ON. How are the variables retrieved by your script? Quote Link to comment https://forums.phpfreaks.com/topic/7538-php-mail-error/#findComment-27445 Share on other sites More sharing options...
tulleh Posted April 16, 2006 Author Share Posted April 16, 2006 [!--quoteo(post=365279:date=Apr 16 2006, 12:26 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 16 2006, 12:26 PM) [snapback]365279[/snapback][/div][div class=\'quotemain\'][!--quotec--]If it used to work perfectly and then stopped working AND you didn't make any changes to it, then possibly your host upgraded php to a version where register_globals is OFF and your code assumed it was ON. How are the variables retrieved by your script?[/quote]Well, I did make some changes to it. I just changed everything to an index.php?p= format, so I only needed one master page. Then when I found it wasn't working, I changed the contact page back, and it still isn't working.I get my variables from a form, though...[code]<?php// $mailto - set to the email address you want the form// sent to, eg//$mailto = "youremailaddress@example.com";$mailto = 'info@biopanda-diagnostics.com';// $subject - set to the Subject line of the email, eg//$subject = "Feedback Form";$subject = "Biopanda Feedback";// the pages to be displayed, eg//$formurl = "http://www.example.com/feedback.html";//$errorurl = "http://www.example.com/error.html";//$thankyouurl = "http://www.example.com/thankyou.html";$formurl = "http://biopanda-diagnostics.com/index.php?p=contact";$errorurl = "http://biopanda-diagnostics.com/index.php?p=formerror";$error2url = "http://biopanda-diagnostics.com/index.php?p=emailerror";$thankyouurl = "http://biopanda-diagnostics.com/index.php?p=formsuccess";// -------------------- END OF CONFIGURABLE SECTION ---------------$name = $_POST['name'];$email = $_POST['email'];$email2 = $_POST['email2'];$comments = $_POST['comments'];$organisation = $_POST['organisation'];$phone = $_POST['phone'];$http_referrer = getenv( "HTTP_REFERER" );if (!isset($_POST['email'])) {ob_start(); header("Location: $formurl");ob_end_flush(); exit;}if (empty($name) || empty($email) || empty($comments) || empty($organisation) || empty($email2)) {ob_start(); header("Location: $errorurl");ob_end_flush(); exit;}if ($email != $email2) {ob_start(); header("Location: $error2url");ob_end_flush(); exit;}$name = strtok( $name, "\r\n" );$email = strtok( $email, "\r\n" );if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments );}$messageproper = "This message was sent from:\n" . "$http_referrer \n" . "Organisation:" . "$organisation" . "\n" . "Phone number:" . $phone . "\n------------------------- COMMENT -------------------------\n\n" . "$comments" . "\n\n------------------------------------------------------------\n";mail($mailto, $subject, $messageproper, "From:" . "$name <$email>\r\nReply-To: $name <$email>");ob_start();header("Location: $thankyouurl");ob_end_flush();exit;?>[/code]Here's the whole script. Quote Link to comment https://forums.phpfreaks.com/topic/7538-php-mail-error/#findComment-27447 Share on other sites More sharing options...
tulleh Posted April 21, 2006 Author Share Posted April 21, 2006 Any help at all? :( Quote Link to comment https://forums.phpfreaks.com/topic/7538-php-mail-error/#findComment-29503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.