我正在使用以下脚本通过 PHP 发送电子邮件。但是,我收到错误"PHP Warning: mail(): Found numeric header (4) in /home/....public_html/.../sendemail.php on line 16"请提供任何帮助。
PHP 脚本
<?php
$name = @trim(stripslashes($_POST['name']));
$from = @trim(stripslashes($_POST['email']));
$subject = @trim(stripslashes($_POST['subject']));
$message = @trim(stripslashes($_POST['message']));
$to = 'xxxxx@xmail.com';
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=UTF-8";
$headers[] = "From: {$name} <{$from}>";
$headers[] = "Reply-To: <{$from}>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
mail($to, $subject, $message, $headers);
die;
慕无忌1623718