테스트 메일은 되는데 메일 수신이 안됩니다.
본문
홈페이지 제작한 업체가 망해서 직접 관리하려는데 잘 안되네요.
관리자페이지나 호스팅 서비스 상의 문제는 없는 것 같습니다.
아무래도 mail.lib.php 파일의 문제 같아 코드를 첨부합니다.
혹시나 코드에 이상이 있다면 알려주시면 정말 감사하겠습니다.
mail.lib.php
<?php 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);
$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']); } } return $mail->send(); }
// 파일을 첨부함 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; } ?> |