php MAIL() 函数有关问题

WBOY
Freigeben: 2016-06-13 12:55:10
Original
968 Leute haben es durchsucht

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

php email
------解决方案--------------------
必须要自动登录,PHPMAILER 当然是备选方案之一
------解决方案--------------------
不能为实现功能而实现,还是多了解一下相关的知识吧,要不然永远也就只能停留在哪个层面。
Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!