테스트 사이트 - 개발 중인 베타 버전입니다

phpmailer 가 수신이 안됩니다. 채택완료

시우우 6년 전 조회 4,442

안녕하세요.

그누보드5에서 phpmailer를 사용해 폼양식에 작성된글을

어드민메일로 발송되는 기능을 사용중입니다.

문제는 해당 어드민메일주소를 네이버계정으로 했을때는 정상적으로 수신되지만

저희 도메인으로 바꿔놓으면 아예 수신이 안됩니다.

메일로그를 봐도 발신은 되었는데 수신이 안됩니다.. ㅠㅠ

이경우 어떻게 해결해야될까요 ?ㅠㅠ

후이즈 호스팅 사용중입니다!

 

config에는 $admin_mail = "admin@example.com" 이런식으로 설정되어있습니다.

 

<?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;
    }
    $fmail = "admin@example.com";
    $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;
}
?>

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
6년 전

해당 메일서버에서 신뢰할 수 없는 도메인을 차단하는 현상으로 보여집니다

 

화이트 도메인 등록이나 구글에서 하는 메일 등록 등 신뢰할 수 있는 메일 서버임을 인증하셔야 합니다

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인