BCC에서 전자 메일 주소를 추가하는 방법을 알아 내려고하고 있습니다. 맹목적인 전자 메일 주소를 추가하기 위해 "$ headers"를 추가 했으므로 전체 코드가 더 이상 작동하지 않습니다.PHP 코드의 BCC에 전자 메일 주소 추가
<?php
// put your email address here
$youremail = '[email protected]';
// if the url field is empty
if(isset($_POST['url']) && $_POST['url'] == ''){
// prepare message
$body = "Nuovo messaggio dal sito web :
Nome: $_POST[name]
Azienda: $_POST[company]
Telefono: $_POST[phone]
Email: $_POST[email]
Messaggio: $_POST[message]";
if($_POST['email'] && !preg_match("/[\r\n]/", $_POST['email'])) {
$headers = "From: $_POST[email]";
} else {
$headers = "From: $youremail";
}
$headers .= "Bcc: [email protected]\r\n";
mail($youremail, 'Richiesta Informazioni dal Sito Web', $body, $headers);
}
?>
나는 보통 PHPMailer를 사용합니다. http://phpmailer.worxware.com/ – Populus