我需要添加一個條件。如果$contact_subject
大於數字50000,它應該轉到一個電子郵件地址,如果它更小,它應該轉到另一個電子郵件地址。根據答覆發送到不同的電子郵件
if($contact_name == true)
{
$sender = $contact_email;
$receiver = "[email protected]";
$client_ip = $_SERVER['REMOTE_ADDR'];
$email_body = "Name: $contact_name \nEmail: $sender \nAccount Number: $contact_subject \nMessage: $contact_message \nIP: $client_ip \nEmail Sent from website http://www.website.com";
$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
if(mail($receiver, "Email From Website - $subject", $email_body, $extra))
{
echo "success=yes";
}
else
{
echo "success=no";
}
}
您是否嘗試過使用if .... elseif語句? – Jim
我並不擅長這一點。我將與Amal的建議合作。 – betti
會讓你知道盡快Amal。 – betti