Page 1 of 1

Problem with PHP email handler

Posted: Sun Mar 30, 2014 7:56 am
by adsparrow
Hi All,

This was working and I never changed anything and now all of a sudden its not working. Here is my PHP:

Code: Select all

<?php

$emailTo = "d.sparrow@cox.net";
$name = $_POST["name"];
$company = $_POST["company"];
$phone = $_POST["phone"];
$emailFrom = $_POST["email"];
$message = $_POST["message"];
$subject = "New message from Too Neat Studios";

if( !empty( $_POST ) ) {
	$body  = "Name: " . $name . "\n\n";
	$body .= "Company: " . $company . "\n\n";
	$body .= "Phone: " . $phone . "\n\n";
	$body .= "Email: " . $emailFrom . "\n\n";
	$body .= "Message:\n" . $message;
	$body  = wordwrap($body, 70);
	$header = "From: " . $emailFrom . "\nReply-To: " . $emailFrom. "\n\n";
	
	if( mail( $emailTo, $subject, $body, $header ) ) {
		echo( "result=Successful" );
		
	} else {
		echo( "result=Unsuccessful" );
	}
}

?>
when i submit the form I get a result=Successful back, but I never get the email, and like I said it was working a few weeks ago and I didn't change anything??
And I'm receiving emails from elsewhere so I know my email is working.... Any Ideas?

Re: Problem with PHP email handler

Posted: Sun Mar 30, 2014 8:01 am
by Celauran
mail() returning true doesn't necessarily mean the mail was delivered. Check your mail server logs and go from there.