3
這是我的代碼:爲什麼郵件在php中失敗?
<?php
//define the receiver of the email
$to = '[email protected]';
//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: [email protected]";
//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";
?>
- 返回郵件失敗
請幫我
刪除`@`的`郵件前()`函數,如果任何告訴我們顯示錯誤/警告。 – 2011-01-08 09:13:13
在哪裏託管的網頁? – 2011-01-08 09:15:26