我有發送電子郵件的代碼到我的郵箱PHP不能發送電子郵件
,但如果我按OK我收到無法發送電子郵件至* *@hotmail.com
我的Linux服務器上運行( Fedora的),而我不不更改任何設置
我mail.html文件
<html>
<head><title>Mail sender</title></head>
<body>
<form action="mail.php" method="POST">
<b>Email</b><br>
<input type="text" name="email" size=40>
<p><b>Subject</b><br>
<input type="text" name="subject" size=40>
<p><b>Message</b><br>
<textarea cols=40 rows=10 name="message"></textarea>
<p><input type="submit" value=" Send ">
</form>
</body>
</html>
和我email.php文件是:
<html>
<head><title>PHP Mail Sender</title></head>
<body>
<?php
# Retrieve the form data
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
# Sends mail and report success or failure
if (mail($email,$subject,$message)) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>
</body>
</html>
請儘量幫我
你是不是想從本地主機發送電子郵件?如果是的話,然後檢查以下鏈接http://stackoverflow.com/questions/4595730/sending-email-from-localhost –
@ManishGoyal我嘗試它,但同樣的結果 – user3264926