我是PHP的新手,在我的注册表单上遇到了一些问题。 以下脚本无法运行。并保持错误
警告:mail():SMTP服务器响应:550这是一个仅提交端口。您必须在第40行E:\ inetpub \ abc.com.my \ wwwroot \ abc_Draft9_190713 \ processor.php发送邮件之前进行身份验证“任何想法?谢谢。
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
$title = $_REQUEST['textfield_1'];
$firstname = $_REQUEST['textfield_2'];
$lastname = $_REQUEST['textfield_3'];
$email = $_REQUEST['textfield_4'];
$mobile = $_REQUEST['textfield_5'];
$interesteddevelopement = $_REQUEST['textfield_6'];
$message = $_REQUEST['textfield_7'];
if (!($firstname && $lastname && $mobile && $email && $interesteddevelopement && $message)) {
?>
<script language = 'javascript'>
alert('Please fill in every required field.');
history.back();
</script>
<?php
exit();
} else {
ini_set("SMTP","mail.abc.com.my");
ini_set("smtp_port","587");
//ini_set('sendmail_from', 'ValidEmailAccount@YourDomain.com');
$headers = "From: $email";
mail("abc@interactive.com.my","abc Website Enquiry Form","
Title : " . $_POST['textfield_1'] . "
First Name : " . $_POST['textfield_2'] . "
Last Name : " . $_POST['textfield_3'] . "
Email : " . $_POST['textfield_4'] . "
Mobile : " . $_POST['textfield_5'] . "
Interested Developement : " . $_POST['textfield_6'] . "
Message : " . $_POST['textfield_7'] . "
",$headers);
include("confirmed.html");
}
?>
答案 0 :(得分:0)
php.ini & SMTP= - how do you pass username & password
PHP mail()命令不支持身份验证。你的选择:......