您可以使用基本标题来完成此操作.
<?PHP $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: Jack Sparrow <jsparrow@blackpearl.com>' . PHP_EOL . 'Reply-To: Jack Sparrow <jsparrow@blackpearl.com>' . PHP_EOL . 'X-Mailer: PHP/' . PHPversion(); mail($to,$subject,$message,$headers); ?>