나는 관리자와 사용자 모두에게 다른 이메일을 보내고 싶습니다. 그 방법을 모릅니다. 내가 당신과 공유하는 코드는 관리자와 사용자 모두에게 동일한 이메일을 보내고 있습니다. 제발 도와주세요. 제발 ..PHP에서 관리자와 사용자에게 다른 메시지를 보내는 방법
여기 내 코드입니다;
$car = $_POST['category'];
$pick = $_POST['text1'];
$drop = $_POST['text2'];
$source = $_POST['text3'];
$email= $_POST['text4'];
$to="$email";
$subject="Web Enquiry";
$message="Hi,". "\r\n" . "\r\n" .
"You've received an email with following details, from the inquiry made at the website- [email protected]" ."\r\n"."\r\n".
"Car Category:"." "."$car"."\r\n".
"Source Location:"." "."$pick"."\r\n".
"Destination Location:"." "."$drop"."\r\n".
"Day and Time.:"." "."$source". "\r\n".
"Email:"." "."$email". "\r\n" ."\r\n".
"Thanks & Regards,". "\r\n" .
"Web Admin"."\r\n" ;
$headers ="From:$email\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$headers.="MIME-Version: 1.0\n";
$headers.="Content-type: text/html; charset=iso 8859-1";
if(mail($to, $subject, $message,$headers))
{
echo "Your Message has been sent." ;
} else {
echo "";
}
다른 변수를 보낼 때마다 'mail()'을 두 번 호출하십시오. – nogad
데모를 어떻게 보여줄 수 있습니까? – Narinder
메일 (_VARS 여기); 메일 (_DIFFIRENT_VARS 여기); – nogad