Forums

PHP

This topic is locked

sending to 2 emails via form.

Posted 11 Oct 2004 20:18:21
1
has voted
11 Oct 2004 20:18:21 Simon Bloodworth posted:
Hi

I need to try and get my form to deliver to 2 emails - one which will be predifined and one which is pulled from the form. Im used to working with cdonts but my server no longer supports them. In cdonts you could also add a 'bcc' which could have a predifined email in. Can you do something similiar in PHP?

My code is as follows:
<?
$msg .= "Order Confirmation\n\n";
$msg .= "-----------------------------------\n\n";
$msg .= "Below you we see full details of your order and your delivery information:\n\n";
$msg .="Order Details: $contents\n\n";
$msg .= "Order: \n\n";
$msg .= "-----------------------------------\n\n";
$msg .="Your Details:\n\n";
$msg .= "Your Name: $firstname $lastname\n";
$msg .= "E-Mail Address: $email\n";
$msg .= "Postal Address: $address1, $address2\n";
$to = "$email";
$subject = "Thank you for your order $firstname";
$mailheaders = "From: Order Confirmation <> \n";
$mailheaders .= "Reply-To: $sender_email\n\n";
mail($to, $subject, $msg, $mailheaders);
?>

Any help would be greatly appreciated.

Regard

Simon

Reply to this topic