Mail() headers!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
whci98
Forum Newbie
Posts: 3
Joined: Fri Nov 07, 2003 10:41 am

Mail() headers!

Post by whci98 »

Hi, I'm using the mail() function to send mail. I'm having problems with the headers. Can someone please tell me what am I doing wrong. When I send the mail without the headers it goes through fine. With the headers the mail does not go through. All my variables are coming from a Flash file. Thanks :?


Code: Select all

<?php
		
		
		// contactus.php
		
		$mailTo = "<whci98@noumanzafar.com>";
		
		
		
		$mailSubject = "Contact us (Rhonen Group)";
		$headers = "Name:$senderfName $senderlName $senderEmail\r\n";
		$headers .= "Phone:($areacode) $phone $number $extn\r\n"
		$mailMessage = "Comments:\n\n $senderComments";
		
		//Send mail
		mail($mailTo, $mailSubject, $mailMessage, $headers);
		
		$response = "Thank you $senderfName $senderlName,\n\nYour message has been recieved. We will get back to you within 24 hours. Thank you for your interest in Rhonen Group";
		
// Respond to Flash movie!		
print "&result=Okay&response=$response"; 			 
		
		

?>
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

I could be wrong but I don't think Name and Phone are valid email headers.... I've never come accross them any way.

Usual headers are FROM: CC: BCC: and any other MIME related stuff.
Post Reply