因此,我将这段代码用于 php 邮件,当我在网站的联系表上对其进行测试时,我一直在获取我的电子邮件地址,而不是实际的发件人电子邮件。有什么帮助吗?顺便说一句,我在收件人地址中使用我的电子邮件。
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$call = $_POST['call'];
$website = $_POST['website'];
$priority = $_POST['priority'];
$type = $_POST['type'];
$message = $_POST['message'];
$formcontent=" From: $name \n Phone: $phone \n Call Back: $call \n Type: $type \n Message: $message";
$recipient = "myemail@address.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
?>