php MAIL() 函数有关问题
程序员文章站
2022-05-07 20:19:27
...
php MAIL() 函数问题
include_once('conn.php');
$activationKey = mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand();
$username = mysql_real_escape_string($_POST[username]);
$password = mysql_real_escape_string($_POST[pwd]);
$email = mysql_real_escape_string($_POST[email]);
$sql="INSERT INTO users (username, password, email, activationkey, status) VALUES
('$username', '$password', '$email', '$activationKey', 'verify')";
echo "An email has been sent to $_POST[email] with an activation key. Please check your mail to complete registration.";
//Send activation Email
$to = $_POST[email];
echo $to;
$subject = " hajin.com Registration";
$message = "Welcome to our website!\r\rYou, or someone using your email address, has completed registration at hajin.com. You can complete registration by clicking the following link:\rhttp.//www.YOURWEBSITE.com/verify.php?$activationKey\r\rIf this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ hajin.com Team";
$headers = 'From: bigboylike@ sina.com' . "\r\n" .
'Reply-To: bigboylike@sina.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
提示错误 Warning: mail() [function.mail]: SMTP server response: 503 5.5.2 Need Rcpt command. in E:\WEB\goo\yx.php on line 20
include_once('conn.php');
$activationKey = mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand();
$username = mysql_real_escape_string($_POST[username]);
$password = mysql_real_escape_string($_POST[pwd]);
$email = mysql_real_escape_string($_POST[email]);
$sql="INSERT INTO users (username, password, email, activationkey, status) VALUES
('$username', '$password', '$email', '$activationKey', 'verify')";
echo "An email has been sent to $_POST[email] with an activation key. Please check your mail to complete registration.";
//Send activation Email
$to = $_POST[email];
echo $to;
$subject = " hajin.com Registration";
$message = "Welcome to our website!\r\rYou, or someone using your email address, has completed registration at hajin.com. You can complete registration by clicking the following link:\rhttp.//www.YOURWEBSITE.com/verify.php?$activationKey\r\rIf this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ hajin.com Team";
$headers = 'From: bigboylike@ sina.com' . "\r\n" .
'Reply-To: bigboylike@sina.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
提示错误 Warning: mail() [function.mail]: SMTP server response: 503 5.5.2 Need Rcpt command. in E:\WEB\goo\yx.php on line 20
php
email
------解决方案--------------------
必须要自动登录,PHPMAILER 当然是备选方案之一
------解决方案--------------------
不能为实现功能而实现,还是多了解一下相关的知识吧,要不然永远也就只能停留在哪个层面。
------解决方案--------------------
必须要自动登录,PHPMAILER 当然是备选方案之一
------解决方案--------------------
不能为实现功能而实现,还是多了解一下相关的知识吧,要不然永远也就只能停留在哪个层面。
相关文章
相关视频
专题推荐
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
上一篇: 网页只允许中国用户访问
推荐阅读
-
php的mail函数发送UTF-8编码中文邮件时标题乱码的解决办法
-
PHP中preg_match函数正则匹配的字符串长度问题
-
PHP mail()函数使用及配置方法
-
2个自定义的PHP in_array 函数,解决大量数据判断in_array的效率问题
-
php中有关字符串的4个函数substr、strrchr、strstr、ereg介绍和使用例子
-
PHP中遇到BOM、
编码导致json_decode函数无法解析问题 -
PHP json_encode() 函数详解及中文乱码问题
-
PHP中iconv函数转码时截断字符问题的解决方法
-
php中mail函数发送邮件失败的解决方法
-
约瑟夫环问题的PHP实现 使用PHP数组内部指针操作函数
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论