2017-08-18 12 views
0

私は問題なしでメールを送信できますが、ヘッダー引数に入力してもメールはCCになりません。私は以下のコードで何かを見逃していますか?Wordpressでwp_mail()を使用してCcにメールを送信する際に問題が発生しました

$to = '[email protected]'; 

$subject = 'This email came from the site!'; 

$headers = array(
    'Content-type: text/html', 
    'Cc: [email protected]', 
); 

$body = $_POST['message']; 
$response = wp_mail($to, $subject, $body, $headers); 
+0

[ここhttps://stackoverflow.com/questions/30098670/sending-emails-with-bcc-and-cc-with-wp-mail](https://stackoverflow.com/questionsをご覧ください。/30098670/send-with-bcc-and-cc-with-wp-mail) –

答えて

0

だから、問題は、私はこのフォーマット

Alias Name <[email protected]>

だけではなく、電子メール

[email protected]で私の配列には、cc電子メールを追加するために必要なことです。

今、電子メールが正しく参照されています。

完全な作業サンプル。

$to = '[email protected]'; 

$subject = 'This email came from the site!'; 

$headers = array(
    'Content-type: text/html', 
    'Cc: Alias Name <[email protected]>', 
); 

$body = $_POST['message']; 
$response = wp_mail($to, $subject, $body, $headers); 
関連する問題