我已经在我的实时站点中编写了这段代码。
$to = "samplmail@gmail.com";
$subject = "sample";
$message = "hiiiiiiiiiii";
$from = "samplmail@yahoo.com";
$headers = "From: " .$from. "\r\n";
$headers .= "Reply-To: ". $to. "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$mail = mail($to, $subject, $message, $headers);
if( $mail ) {
echo "mail sent";
} else {
echo "mail not sent";
}
但它打印“邮件未发送”。而且我也没有收到任何电子邮件。请帮我解决这个问题。