0
交付我有我的網站的電子郵件的形式,但這裏的設置適當的電子郵件主題行是問題:當我收到一封電子郵件,主題行中我的收件箱顯示任何用戶輸入爲主體形式。編號喜歡重寫,以便無論何時電子郵件進入。電子郵件標題中的主題始終是「從您的網站查詢」。在郵件正文中,我確定不介意他們輸入的具體主題,但是當我收到電子郵件時,我的收件箱中的一致性等ID。從電子郵件的形式
這是當前的代碼:
<?php session_start();
if(isset($_POST['Submit'])) { if($_SESSION['chapcha_code'] == $_POST['chapcha_code'] && !empty($_SESSION['chapcha_code'])) {
$youremail = 'xxxxxxxxx';
$fromsubject = 'An inquiry from your website';
$title = $_POST['title'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$mail = $_POST['mail'];
$address = $_POST['address'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$headers = "From: $nome <$mail>\r\n";
$to = $youremail;
$mailsubject = 'Message received from'.$fromsubject.' Contact Page';
$body = $fromsubject.'
The person that contacted you is '.$fname.' '.$lname.'
Address: '.$address.'
'.$city.', '.$zip.', '.$country.'
Phone Number: '.$phone.'
E-mail: '.$mail.'
Subject: '.$subject.'
Message:
'.$message.'
|---------END MESSAGE----------|';
echo "Thank you for inquiring. We will contact you shortly.<br/>You may return to our <a href='/index.html'>Home Page</a>";
mail($to, $subject, $body, $headers);
unset($_SESSION['chapcha_code']);
} else {
echo 'Sorry, you have provided an invalid security code';
}
} else {
echo "You must write a message. </br> Please visit our <a href='/contact.html'>Contact Page</a> and try again.";
}
?>
感謝您的信息。你能告訴我如何做出調整。我的技能僅限於HTML/CSS的東西。我失去了這種特殊類型的代碼。 – DC1
所以略低於,你必須 '$到= $ youremail; 。$ fromsubject '從接收到的消息' $ mailsubject =「。聯繫頁面'; $ body = $ fromsubject.'' add '$ subject =「Your Message here」;' 這將重置該變量的預期用途。 –