小编Dan*_*her的帖子

为什么邮件在PHP中失败?

这是我的代码:

<?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";
?>
Run Code Online (Sandbox Code Playgroud)

- 它返回邮件失败

请帮我

php email

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

email ×1

php ×1