我試圖發送確認郵件到兩名成員,但即時通訊困惑,如何做到這一點。以下只是相關的代碼。 香港專業教育學院在我的網站聯繫人頁面,這是很好的使用PHP郵件之前,但我不知道如何將它發送給不止一個人。你能告訴我什麼我做錯了嗎?發送確認郵件到兩個用戶
功能交換:
//full code for exchange not included
// Redirect to index page if exchange is successful
if ($success){
sendMail($coinsAvail['Email'],$valueResultAdd['Email'],$valueResultAdd['OddJobName']);
header("location: index.php?success=yes&email={$valueResultAdd['Email']}");
}
else{
if($success)
header("location: index.php?success=no&email={$valueResultAdd['Email']}");
}
exit();
function to send email
}
//Send a confirmation email to both members
function sendMail($purchaseEmail, $oddjobEmail, $oddJobName)
{
$to = "$purchaseEmail, $oddjobEmail";
$subject = "$oddJobName";
$message = "Hello! $oddJobName has been requested by $purchaseEmail.";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
}
謝謝您的幫助。
將它發送給許多人,只是用怎麼樣您通過雅虎,Gmail帳戶發送電子郵件給多個人的「逗號」分隔符。 –