Send mail question...

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
ssand
Forum Commoner
Posts: 72
Joined: Sat Jun 22, 2002 9:25 pm
Location: Iowa

Send mail question...

Post by ssand »

I have a simple mail statement:

Code: Select all

$toaddress = "jim@designedimages.com";
	$subject = "Quote/Comment request from $from_name";
	$mailcontent = "Customer Name: ".$from_name."\n"
					   ."Customer Email: ".$from_email."\n"
					   ."Customer Comments: \n".$message."\n";
	$fromaddress = "From: ".$from_email."\n";
	mail($toaddress, $subject, $mailcontent, $fromaddress);
It works fine as long as the email is sent to an address other than one @designedimages.com - my client's server (right now I am receiving the email to my server, Unix, and forwarding the messages to my client's email address on a Windows NT server).

Obviously the send mail works, but won't send to their local address. Since it is a local address do I just specify the email address as "jim" only???

Any help is appreciated.
Thanks - Steve
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Does this mean anything to you? It doesn't to me but hey....
The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn't use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second, the custom headers like From:, Cc:, Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. PHP < 4.3 only supported the Cc: header element (and was case-sensitive). PHP >= 4.3 supports all the mentioned header elements and is no longer case-sensitive.
Post Reply