我做了一个联系表,它几乎可以正常工作。
<?php
$contact_name = $_POST['contact_name'];
$contact_email = $_POST['contact_email'];
$contact_tel = $_POST['contact_tel'];
$contact_call = $_POST['contact_call'];
$contact_message = $_POST['contact_message'];
$formcontent=" Von: $contact_name \n Tel.: $contact_tel \n Rückruf: $contact_call \n Nachricht: <br> $contact_message";
$recipient = "jonathanrobrecht@googlemail.com";
$subject = "Kontaktformular";
$from = '$contact_email';
$mailheader = "Von: $contact_email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>
那是php,当我在电子邮件客户端中收到一封电子邮件时,我收到了主题的信息,但没有发送电子邮件的人(我的网络服务器的地址已显示),但我希望填写的电子邮件是电子邮件.
我试过这个:
$subject = "Kontaktformular";
$from = '$contact_email';
$subject 确实有效,但 from 无效,我该如何解决这个问题?