require 'PHPMailer/class.phpmailer.php';
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$body = "恭喜你已经成功注册";
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "mail.fjlds.com"; // SMTP server
$mail->Username = "np@fjlds.com"; // SMTP server username
$mail->Password = "vv333123456"; // SMTP server password
$mail->AddReplyTo("np@fjlds.com","First Last");
$mail->From = "np@fjlds.com";
$mail->FromName = "恒一网络";
$to = "np@fjlds.com";
$mail->AddAddress($to);
$mail->Subject = "您在本网站已经成功注册";
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
我想在getpass.php页面中把随机产生的密码发送到注册者的邮箱中 如何实现