이메일을 보내기 위해 phpmailer 클래스를 사용합니다. 오류가 발생했습니다. "실행할 수 없습니다 :/smtp"코드가 아래 코드와 같습니다. 누군가가 내게 어떤 문제인지 제안 해 줄 수 있습니까?phpmailer 클래스 사용
require '../class.phpmailer.php';
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$body = file_get_contents('contents.html');
echo $body;
$body = preg_replace('/\\\\/','', $body); //Strip backslashes
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "ssl://smtp.gmail.com"; // SMTP server
$mail->Username = "[email protected]"; // SMTP server username
$mail->Password = "1234567889"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AddReplyTo("[email protected]","First Last");
$mail->From = "[email protected]";
$mail->FromName = "First Last";
$to = "[email protected]";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
정확히지고 어떤 오류 라인? –