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”;' 这将重置该变量的预期用途。 –