gpt4 book ai didi

php - 无法使用 000webhost webmail 在 PHP 联系表单中发送邮件

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:48:01 26 4
gpt4 key购买 nike

<分区>

我正在使用 000webhost webmail 通过联系表单接收电子邮件,但它不起作用。

contact.php

     <form  action="mailer.php" method="post">
<p>Name:</p>
<input type="text" name="name" />
<p>E-mail:</p>
<input type="text" name="email" />
<p>Subject:</p>
<input type="text" name="subject" />
<p>Message:</p>
<textarea name="message"></textarea></p>
<input class="send" type="submit" value="Send" name="submit">
</form>

ma​​iler.php

     <?php

$to = "xxx@xxxxx.com";
$subject = "Support requested by ".$_POST['name'];
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$headers = 'From: '.$_POST['email'].'' . "\r\n" .
'Reply-To: '.$_POST['email'].'' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

$body = $message;

@mail($to, $subject, $body, $headers );
header( 'Location:thankyou.php' ) ; //replace with landing page.
?>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com