我正在尝试发送电子邮件。但我的代码不起作用。你能错过哪一步吗?
发信息Email.php
<?php
if($_REQUEST['name'] == '' || $_REQUEST['email'] == '' || $_REQUEST['message'] == ''):
return "error";
endif;
if (filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)):
$to = 'sendmeyour_Query@yahoo.com';
// prepare header
$header = 'From: '. $_REQUEST['name'] . ' <'. $_REQUEST['email'] .'>'. "\r\n";
$header .= 'Reply-To: '. $_REQUEST['name'] . ' <'. $_REQUEST['email'] .'>'. "\r\n";
$header .= 'X-Mailer: PHP/' . phpversion();
$subject = "Email from KG Construction Website";
$message .= 'Name: ' . $_REQUEST['name'] . "\n";
$message .= 'Email: ' . $_REQUEST['email'] . "\n";
$message .= 'Message: '. $_REQUEST['message'];
$mail = mail( $to, $url , $message, $header );
return $mail ? "success" : "error";
else:
return "error";
endif;
?>
&#13;
请帮我解决这个问题。