【发布时间】:2014-02-09 09:31:11
【问题描述】:
我有发送电子邮件到我的电子邮件的代码
但如果我按确定,我将无法向 **@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>
请帮帮我
【问题讨论】:
-
您是否尝试从本地主机发送电子邮件?如果是,请检查以下链接stackoverflow.com/questions/4595730/…
-
@ManishGoyal 我正在尝试,但结果相同