Add BCC parameter to mail()

View: New views
2 Messages — Rating Filter:   Alert me  

Add BCC parameter to mail()

by coolcat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi folks - Newbie question...

Q: Is there a way to add BCC and/or CC parameters to this simple email  
function?

If there is a better way to do this - please let me know....

Thanks in advance....


<?php
$Name = "test"; //senders name
$email = "test@..."; //senders e-mail adress
$recipientname = "test";
$recipient = "joe@..."; //recipient
$mail_body = "test";
$subject = "test";
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional  
headerfields

$fullto = $recipientname . " <" . $recipient . ">";

ini_set('sendmail_from', 'test@...');

mail($fullto, $subject, $mail_body, $header); //mail command :)
?>


Thanks,
cool@...




Re: Add BCC parameter to mail()

by Ashley Sheridan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2009-07-05 at 18:55 -0700, cool@... wrote:

> Hi folks - Newbie question...
>
> Q: Is there a way to add BCC and/or CC parameters to this simple email  
> function?
>
> If there is a better way to do this - please let me know....
>
> Thanks in advance....
>
>
> <?php
> $Name = "test"; //senders name
> $email = "test@..."; //senders e-mail adress
> $recipientname = "test";
> $recipient = "joe@..."; //recipient
> $mail_body = "test";
> $subject = "test";
> $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional  
> headerfields
>
> $fullto = $recipientname . " <" . $recipient . ">";
>
> ini_set('sendmail_from', 'test@...');
>
> mail($fullto, $subject, $mail_body, $header); //mail command :)
> ?>
>
>
> Thanks,
> cool@...
>
>
>
rtfm http://uk3.php.net/manual/en/function.mail.php


Thanks
Ash
www.ashleysheridan.co.uk


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php