0

我无法让这段代码工作我知道如何使用 PHP 的邮件部分并且无法理解有什么问题。

##Send activation Email

$to      =  $_POST['email'];

$subject = " YOURWEBSITE.com Registration";

$message = "Welcome to our website!\r\rYou, or someone using your email address, has completed registration at YOURWEBSITE.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,\ YOURWEBSITE.com Team";

$headers = 'From: noreply@close2.me';


mail($to, $subject, $message, $headers);
4

1 回答 1

0

看下面的教程

http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html

http://php.net/manual/en/function.mail.php

使用 smtp 身份验证发送邮件是一种解决方案,或者您可以使用邮件库,如 swift mailer

于 2012-10-16T04:56:17.297 回答