Page 1 of 1
Mail............
Posted: Wed Jan 07, 2009 7:05 am
by kushaljutta
hi
i need some about mail function..
ie,how can i send Bcc,Cc mails in php ueing mail()..
thanks in advance
Re: Mail............
Posted: Wed Jan 07, 2009 7:08 am
by mattpointblank
Googling for about 20 seconds resulted in this:
Code: Select all
<?php
// switch the value of $email to the
// persons email address you are sending
// this to.
$email = "username@myisp.com";
$subject = "Working PHP v4.0b4 mail script";
$body = "Um, looks good from here.";
$headers = "From: mymailer@mydomain.com\n";
$headers .= "Reply-to: noreply@mydomain.com\n";
$headers .= "Bcc: username@myisp.com\n";
$headers .= "Bcc: username@myisp.com\n";
$headers .= "Bcc: username@myisp.com\n";
$headers .= "Bcc: username@myisp.com\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
mail ($email, $subject, $body, $headers);
echo "schweeeeeet.....its workin'";
?>
Replace "Bcc:
username@myisp.com\n"; with "CC:
username@myisp.com\n" for CCs instead.