Page 1 of 1

Sending Mail from PHP

Posted: Wed Aug 29, 2007 8:31 pm
by B.E
Why isn't this working. It's Successfuly but don't receive anything

Code: Select all

function SendNotificationEmail($ToEmail){
	global $AdminEmail;
	global $TestSMSEmail;
	$message = file_get_contents("Email.message");
	$Boundary = "----=_NextPart_001_0038_01C7EAEB.9059B200";
	$headers = 	"From: $AdminEmail \n";
	$headers .= "MIME-Version: 1.0\n" .
             	"Content-Type: multipart/mixed;\n" .
             	" boundary=\"$Boundary\"";

	if (mail($ToEmail, "This is a testmessage", $message, $headers))
		echo "Hey";
	else
		echo "Nay";
}

Posted: Thu Aug 30, 2007 2:15 am
by AndrewAPrice
Is your PHP configuration set up to connect to your mail server? (You usually do this from the PHP config file (php.ini on Windows) - not from within the PHP script.)