if (PEAR::isError($mail)) {
echo("" . $mail->getMessage() . "
");
} else {
echo("Message successfully sent!
");
}
?>
这是非加密方式。
PHPer 多数使用 mail 函数来发送邮件,但我们可以使用其他的 SMTP 服务器来发送,这里推荐使用 PEAR's mail package 来发送邮件。
$subject = "This mail is sent from SMTP.";
$mail_body = "This is the body of the mail which is sent using SMTP.";
$from = "From: From Name ";
$to = "To: To Name ";
$receiver = "toaddress@xpertdeveloper.com";