note 90221 deleted from function.mail by danbrown
| From: | danbrown@php.net | Date: | Fri, 10 Apr 2009 23:02:50 +0000 |
| Subject: | note 90221 deleted from function.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153066@lists.php.net to get a copy of this message | ||
Note Submitter: akam at akameng d*t com
----
I used below code in my website, it's worked great for me!
I hope help some one else for sending cc/bcc!
<?php
$to = 'to-email@domain.tld';
$cc = 'ccemail@domain.tld';
$bcc = 'bcc@domain.tld, bcc1@domain.tld';
$subject = 'subject';
$headers =
"From: \"$from_name\" <$from_email>\r\n".
"Reply-To: $from_email\r\n".
"To: $to\r\n".
( (!empty($cc)) ? "Cc: $cc\r\n": "" ).
( (!empty($bcc)) ? "Bcc: $bcc \r\n" : "" ).
"MIME-Version: 1.0\r\n";
$body = 'test message';
$send = mail($to, $subject, $body, $headers);
if(!$send){
echo 'Mail not send';
}
?>