Mail............

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
kushaljutta
Forum Commoner
Posts: 50
Joined: Fri Dec 26, 2008 11:05 am

Mail............

Post by kushaljutta »

hi

i need some about mail function..

ie,how can i send Bcc,Cc mails in php ueing mail()..

thanks in advance
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Mail............

Post 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.
Post Reply