php - 当我从 SMTP 发送电子邮件时,它的代码成功运行,但我没有在该电子邮件地址上收到电子邮件?
问题描述
我已经更改了 gmail 的安全性,因为不太安全允许并启用 IMAP...还在 sendmail.exe 和 php.ini 中进行一些更改.....
在 sendmail.exe 中......
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
default_domain=localhost
error_logfile=error.log
debug_logfile=debug.log
auth_username=email address from where i send mail
auth_password= my password
hostname=localhost
在 php.ini...
sendmail_path = "C:\wamp64\sendmail\sendmail.exe -t -i"
我的PHP代码...
<?php
$mail=$_REQUEST['mail'];
$otp=rand(100000,999999);
$to=$mail;
$subject= "OTP From Skin Beauty Bar";
$message="hiii...\n Your OTP Is = ".$otp."\n Please Don't Share Yor One Time password";
$headers= "FROM:skinbeautyproducts94@gmail.com";
if(mail($to, $subject, $message, $headers))
{
echo "<script>alert('OTP SENT');window.location.href='otp_pg.php?mail=$mail&msg=$otp';</script>";
}
else{
echo "xyz";
}
?>
解决方案
推荐阅读
- c# - RNGCryptoServiceProvider - 无论字符长度如何,如何获得完全公正的结果?
- php - Symfony 4 记住我 cookie
- python - 如何使用 Python 的 Webbrowser 模块打开多个隐身标签?
- javascript - “高质量”改变音频速度而不影响音高
- mercurial - 使用graft将一个分支的内容移植到另一个分支?
- android - Android Studio 布局 - 在同一行上相邻的两个文本视图的父级中水平居中
- pine-script - 在 Pine-script 中,如何根据自定义指标中当前柱的条件将前一根柱的值分配给当前柱?
- python - 外部摄像头未捕获图像,为帧变量返回 nonetype
- javascript - 为什么HTML拖放数据传输成为iframe内部的对象
- amazon-web-services - terraform apply 试图破坏手动删除的启动配置