0
将表单发送至我的电子邮件时出现问题。 目前,当我发送表单时,我用$ message2从“[email protected]”得到了消息,但是我没有从'inputEmail'得到$ message到我的电子邮件“[email protected]”。PHP - 将表单发送至电子邮件
我想补充一点,我不是PHP程序员,这是我的第一个使用这种语言的脚本。
我会是你的帮助
<?php
$to = '[email protected]'; // this is your Email address
$from = $_POST['inputEmail']; // this is the sender's Email address
$first_name = $_POST['inputName'];
$inputCompany = $_POST['inputCompany'];
$inputPosition = $_POST['inputPosition'];
$inputProjects = $_POST['inputProjects'];
$inputOfficeProjects = $_POST['inputOfficeProjects'];
$inputPresentation = $_POST['inputPresentation'];
$inputMessage = $_POST['inputMessage'];
$number = $_POST['number'];
$subject = "Test";
$subject2 = "Test1";
$message = $first_name . " example " . $inputPosition . " wrote the following:" . "\n\n" . $_POST['message'];
$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
// echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
header('Location: dziekujemy.html');
?>