Sending Mail from PHP

Programming, for all ages and all languages.
Post Reply
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Sending Mail from PHP

Post 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";
}
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post 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.)
My OS is Perception.
Post Reply