我正在使用Windows。当我尝试使用php邮件发送邮件。它返回“无法实例化邮件功能”。它是一些许可问题还是代码有什么问题?谢谢!
<?php
require_once("class.phpmailer.php");//location is correct
require_once("class.smtp.php");//location is correct
$to_name = "Good Better";
$to = "sending@example.com";
$subject = "Mail Test at ".strftime("%T", time());
$message = "This is a test.";
$message = wordwrap($message,70);
$from_name = "My Name";
$from = "myacc@example.com";
$mail = new PHPMailer();
$mail->FromName = $from_name;
$mail->From = $from;
$mail->AddAddress($to, $to_name);
$mail->Subject = $subject;
$mail->Body = $message;
$result = $mail->Send();
echo $result ? 'Sent' : $mail->ErrorInfo;
?>