查看: 773|回复: 1
|
PHP Mail 帮忙!!!
[复制链接]
|
|
我写了这一段:
<?php
$to = "abc@yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "xyz@yahoo.com";
$headers = "From: $from";
echo "$to\n <br/>";
echo "$subject\n<br/>";
echo "$message\n<br/>";
echo "$from\n<br/>";
echo "$headers\n<br/>";
if(mail($to,$subject,$message,$headers))
echo "Mail Sent.";
else
echo "Mail not sent";
?>
我一直都拿到Mail not sent。
是不是我的setting有问题?请帮个忙,谢谢。 |
|
|
|
|
|
|
|
发表于 15-8-2007 01:06 AM
|
显示全部楼层
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?> |
|
|
|
|
|
|
| |
本周最热论坛帖子
|