这是我的代码:
<?php
//define the receiver of the email
$to = 'dannyfeher69@gmail.com';
//define the subject of the email
$subject = 'Test email';
//define the message to be sent.
$message = "Hello World!\n\nThis is my mail.";
//define the headers we want passed.
$header = "From: me@localhost.com";
//send the email
$mail_sent = @mail( $to, $subject, $message);
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
-- 邮件发送失败
请帮助我
mail()
函数前面的@
符号移除,并告诉我们是否有任何错误或警告信息显示。 - Jan Hančič