mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Handle cc and bcc. Props MattyRob. fixes #6899
git-svn-id: http://svn.automattic.com/wordpress/trunk@8098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1349203eed
commit
f5e12d887b
@ -315,6 +315,10 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
|
|||||||
} else {
|
} else {
|
||||||
$content_type = trim( $content );
|
$content_type = trim( $content );
|
||||||
}
|
}
|
||||||
|
} elseif ( 'cc' == strtolower($name) ) {
|
||||||
|
$cc = explode(",", $content);
|
||||||
|
} elseif ( 'bcc' == strtolower($name) ) {
|
||||||
|
$bcc = explode(",", $content);
|
||||||
} else {
|
} else {
|
||||||
// Add it to our grand headers array
|
// Add it to our grand headers array
|
||||||
$headers[trim( $name )] = trim( $content );
|
$headers[trim( $name )] = trim( $content );
|
||||||
@ -360,6 +364,18 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
|
|||||||
$phpmailer->Subject = $subject;
|
$phpmailer->Subject = $subject;
|
||||||
$phpmailer->Body = $message;
|
$phpmailer->Body = $message;
|
||||||
|
|
||||||
|
// Add any CC and BCC recipients
|
||||||
|
if ( !empty($cc) ) {
|
||||||
|
foreach ($cc as $recipient) {
|
||||||
|
$phpmailer->AddCc( trim($recipient) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !empty($bcc) ) {
|
||||||
|
foreach ($bcc as $recipient) {
|
||||||
|
$phpmailer->AddBcc( trim($recipient) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set to use PHP's mail()
|
// Set to use PHP's mail()
|
||||||
$phpmailer->IsMail();
|
$phpmailer->IsMail();
|
||||||
|
|
||||||
@ -1532,4 +1548,4 @@ function wp_text_diff( $left_string, $right_string, $args = null ) {
|
|||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user