note 90221 added to function.mail
| From: | akamatakamengd*tcom at osu1 dot php dot net | Date: | Fri, 10 Apr 2009 22:42:26 +0000 |
| Subject: | note 90221 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153064@lists.php.net to get a copy of this message | ||
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';
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 193.200.150.82
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/90221
Del: integrated -- https://master.php.net/note/delete/90221/integrated
Del: useless -- https://master.php.net/note/delete/90221/useless
Del: bad code -- https://master.php.net/note/delete/90221/bad+code
Del: spam -- https://master.php.net/note/delete/90221/spam
Del: non-english -- https://master.php.net/note/delete/90221/non-english
Del: in docs -- https://master.php.net/note/delete/90221/in+docs
Del: other reasons-- https://master.php.net/note/delete/90221
Reject -- https://master.php.net/note/reject/90221
Search -- https://master.php.net/manage/user-notes.php