채택완료

이메일문제..테스트메일이 네이버에는 오는데 다음에는 오지않아요

2019-04-23 (화) 11:41:44 2,658

네이버에는 정상적으로 오는데 다음메일에는 오질않습니다..

기본 그누보드인데 네이버에 정상적으로 오는걸보니 소스문제는 없는거 같아요! 

서버는 카페 24를 이용하고 있는데 서버쪽에 문제일까요?

gmail / hanmail/ 안되네요..방법이있나요? 

mailer.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;
}
?>

|

답변 1개 / 댓글 4개

채택된 답변
+20 포인트
2019-04-23 (화) 12:59:51

스팸확인하셨나요? 구글 다음등은 html 여부에 따라 스팸처리될수이씁니다

답변에 대한 댓글 4개

스팸에도 메일이 안들어와있더라구요 .. 문제를 못찾겠어요 ..
2019-04-23 (화) 13:33:23
아니시면

config.php 에서

160번라인에 

define('G5_SMTP',  'ip주소')
여기에서 ip주소만 ""공란으로 바꿔보세요
네 그것도 해봤는데 안되요 ..호스팅이 카페24 사용중이라 카페24쪽에 우선 문의는 넣어봤어요 ..
아..다음은 스팸설정을 해줘야 스팸이 보이네요..스팸에 있었어요~ 감사합니다!

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