PHP Mail Question

They have: 38 posts

Joined: Dec 2002

I have a script that sends an email to a friend. I would like it to CC the sender as well on the email. This is the script:

<?
include "PHP_Lib.php";
$subject = $HTTP_GET_VARS["Subject"];
mail("$Recipient_Email","Interesting IT Training URL","Dear $Recipient_First_Name,

I thought that you might be interested in this link: $message.

Thanks,
$Contact_First_Name $Contact_Last_Name",
"From:$Contact_First_Name $Contact_Last_Name\r\n",
"CC:$Contact_Email");
?>

The file "PHP_Lib.php" contains information to send another email to us for database information. the CC doesnt seem to want to work. What can I do?

Thanks!

Jody

He has: 1,016 posts

Joined: May 2002

Perhaps this will help...

Quote: 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.

druagord's picture

He has: 335 posts

Joined: May 2003

all your header info should have \r\n at the end even the last one

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.