메일 테스트 에러(오류) 문의 채택완료
양현국
1년 전
조회 2,261
메일 테스트 하니까
Fatal error: Uncaught Error: Class "PHPMailer" not found in /hosting/ricenterit/html/lib/mailer.lib.php:28 Stack trace: #0 /hosting/ricenterit/html/adm/sendmail_test.php(26): mailer() #1 {main} thrown in /hosting/ricenterit/html/lib/mailer.lib.php on line 28
이런 에러가 뜨고 메일이 제대로 안되는데 혹시 뭐가 문제일까요? ㅠㅠ
http://sir.kr/data/editor/2407/2949168774_1719844007.422.png" width="100%" />
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
1년 전
include_once 에서 문제 같은데요 메일러 불러오는 곳에서 문제가 있나봐요 /hosting/ricenterit/html/lib/mailer.lib.php 경로로 가보세요 그러고 소스코드 올려보세요
로그인 후 평가할 수 있습니다
답변에 대한 댓글 4개
�
양현국
1년 전
�
양현국
1년 전
관심갖여주셔서 감사합니다!
그런데 include_once 에서 문제같다고 하셔서 절대경로로 바꿔보고 했는데, 메시지는 똑같네요... ㅠㅠ
도대체 무엇이 문제인걸까요.. new PHPMailer 이부분이 제대로 실행이 안되고 있는것 같은데...
그런데 include_once 에서 문제같다고 하셔서 절대경로로 바꿔보고 했는데, 메시지는 똑같네요... ㅠㅠ
도대체 무엇이 문제인걸까요.. new PHPMailer 이부분이 제대로 실행이 안되고 있는것 같은데...
�
양현국
1년 전
오! 일단 해결했습니다.
운영중인 다른 사이트에 있는 plugin/PHPMailer메일과 mailer.lib.php 파일을 덮어씌웠더니 됬네요...
나중에 비교분석해보겠습니다.
감사합니다!
운영중인 다른 사이트에 있는 plugin/PHPMailer메일과 mailer.lib.php 파일을 덮어씌웠더니 됬네요...
나중에 비교분석해보겠습니다.
감사합니다!
�
리오닥터
1년 전
그러셨군요~~~
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
if (!defined('_GNUBOARD_')) exit;
include_once(G5_PHPMAILER_PATH.'/PHPMailerAutoload.php');
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g5;
// 메일발송 사용을 하지 않는다면
if (!$config['cf_email_use']) return;
if ($type != 1)
$content = nl2br($content);
$result = run_replace('mailer', $fname, $fmail, $to, $subject, $content, $type, $file, $cc, $bcc);
if( is_array($result) && isset($result['return']) ){
return $result['return'];
}
$mail_send_result = false;
try {
$mail = new PHPMailer(); // defaults to using php "mail()"
if (defined('G5_SMTP') && G5_SMTP) {
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = G5_SMTP; // SMTP server
if(defined('G5_SMTP_PORT') && G5_SMTP_PORT)
$mail->Port = G5_SMTP_PORT;
}
$mail->CharSet = 'UTF-8';
$mail->From = $fmail;
$mail->FromName = $fname;
$mail->Subject = $subject;
$mail->AltBody = ""; // optional, comment out and test
$mail->msgHTML($content);
$mail->addAddress($to);
if ($cc)
$mail->addCC($cc);
if ($bcc)
$mail->addBCC($bcc);
//print_r2($file); exit;
if ($file != "") {
foreach ($file as $f) {
$mail->addAttachment($f['path'], $f['name']);
}
}
$mail = run_replace('mail_options', $mail, $fname, $fmail, $to, $subject, $content, $type, $file, $cc, $bcc);
$mail_send_result = $mail->send();
} catch (Exception $e) {
}
run_event('mail_send_result', $mail_send_result, $mail, $to, $cc, $bcc);
return $mail_send_result;
}
// 파일을 첨부함
function attach_file($filename, $tmp_name)
{
// 서버에 업로드 되는 파일은 확장자를 주지 않는다. (보안 취약점)
$dest_file = G5_DATA_PATH.'/tmp/'.str_replace('/', '_', $tmp_name);
move_uploaded_file($tmp_name, $dest_file);
$tmpfile = array("name" => $filename, "path" => $dest_file);
return $tmpfile;
}