国内邮箱收不到邮件 php,用PHP的mail(),返回成功,但邮箱并未收到?

环境:xammp;Mercury 用的25端口;

7fe16b40680342bd9030329485d3a0d0.png

PHP:

boot

.contact-form{

border: 1px solid #c0c0c0;

margin-top: 30px;

border-radius: 10px;

box-shadow: 3px 3px 16px #c0c0c0;

}

.head{

height: 85px;

}

.head p{

font-size: 40px;

line-height: 85px;

}

.alert p{

font-style: italic;

}

Contact Us

function _post($str){

$val = !empty($_POST[$str]) ? $_POST[$str] : null;

return $val;

}

$name=_post("name");

$email=_post("email");

$message=_post("message");

$errors='';

$missing_name ='

Please enter your name!>';

$missing_email ='

Please enter your Email!>';

$invalid_email ='

Please enter your Valid Email!>';

$missing_message ='

Please enter your Messages!>';

if (_post("submit")){

if (!$name){

$errors.=$missing_name;

}else{

$name=filter_var($name, FILTER_SANITIZE_STRING);

}

if (!$email){

$errors.=$missing_email;

}else{

$email=filter_var($email, FILTER_SANITIZE_EMAIL);

if (!filter_var($email, FILTER_VALIDATE_EMAIL)){

$errors.=$invalid_email;

}

}

if (!$message){

$errors.=$missing_message;

}else {

$message=filter_var($message, FILTER_SANITIZE_STRING);

}

if ($errors){

$resultMessage='

'.$errors.'
';

}else{

$to = "eric.choo1997@gmail.com";

$subject ="Contact";

$message ="

Name: $name

Email: $email

Messages:

$message

";

$headers = "Content-type:text/html";

if (mail($to, $subject, $message, $headers)){

$resultMessage='

Thanks For Your Message.
';

}else{

$resultMessage='

Web Error.
';

}

}

echo $resultMessage;

}

?>

Name:

">

Email

">

Message:

505120db95f8ad1ccaecc2dae2d9526c.png

PHP.ini:

[mail function]

; For Win32 only.

; http://php.net/smtp

SMTP=localhost

; http://php.net/smtp-port

smtp_port=25

; For Win32 only.

; http://php.net/sendmail-from

sendmail_from = eric.choo1997@yahoo.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").

; http://php.net/sendmail-path

;sendmail_path =

Mercury的Do not permit 已经取消勾选;

试了三五个邮箱了,始终不可以。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值