PFB我的代码
Your information$x = $_POST['yourname'];
$email = $_POST['email'];
$msg="Your Name is $x.";
$to='abc@gmail.com';
$sub='Your information';
$header = "From: ". $x . " \r\n";
ini_set("SMTP","smtp.gmail.com" );
ini_set('sendmail_from', 'abc@gmail.com');
//$email is entered as abc@gmail.com
if(mail($to, $sub, $msg,'From:' . $email)){
echo 'success';
}
else{
echo 'failure';
}
echo 'Thanks for submitting your information
';
echo 'Your Name ' . $x . '
' ;
echo 'Email ' . $email . '
' ;
echo $msg;
?>
我需要用我的Gmail帐户(POP / SMTP)配置Outlook 2007。
和php.ini设置是SMTP = smtp.gmail.com
smtp_port = 587.这些设置也与Outlook设置相匹配。
仍然我得到的是在我的浏览器上打印的“失败”。
请帮忙。