我想在CC的郵件功能中使用CC和BCC特定地址,但CC/BCC電子郵件無法成功傳送。將cc,密件抄送和附件添加到電子郵件
<?php
$emailto = "[email protected],[email protected]";
$contacts = explode(",", $emailto);
array_walk($contacts, 'trim');
foreach($contacts as $contact) {
$cc = "[email protected]";
$bcc = "[email protected]";
$tto = $contact;
$tto. ="CC: $cc\r\n";
$tto .= "BCC: $bcc\r\n";
$subject = "hey";
$body = "Test";
$header = 'From: My Name <[email protected]>'
. "\r\n";
$header = "CC: CC Name <$cc>\n";
$header = "BCC: BCC Name <$bcc>\n";
if(mail($tto, $subject, $body, $header)) {
echo "SEND";
}
}
如何解決這個問題?
那麼你的問題是什麼? –
先生,我想添加cc和密件抄送在這個功能,他們sould接收電子郵件作爲cc和密件抄送 –
它看起來像你試圖做你的代碼。執行此代碼時發生了什麼? –