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');
?>