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

네이버 메일 전송이 안됩니다. 채택완료

서포터즈 5년 전 조회 5,070

펜션시스템 이용중 예약하면 메일전송이 되게 해두었습니다.

 

그런데 잘되던게 어제 오후 부터 예약을해도 전송이 되지않기 시작했습니다.

 

개발소스는 건드리지 않았고, adm페이지 조차건드리지 않았는데 갑자기 전송이안되니 당황스럽습니다.

 

adm페이지에있는 테스트 메일전송도 해보았으나 갑자기 전송이 되지않습니다.

 

늘받던 이메일이아닌 다른이메일 여러개도 시도해보았지만 전부 전송 되지않았습니다.

 

혹시몰라 소스코드 남겨봅니다.

 

white_update.php

 

// 메일발송 사용 (수정글은 발송하지 않음) if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_email']) {

    // 관리자의 정보를 얻고     $super_admin = get_admin('super');     $group_admin = get_admin('group');     $board_admin = get_admin('board');

    $wr_subject = get_text(stripslashes($wr_subject));

    $tmp_html = 0;     if (strstr($html, 'html1'))         $tmp_html = 1;     else if (strstr($html, 'html2'))         $tmp_html = 2;

    $wr_content = conv_content(conv_unescape_nl($wr_content), $tmp_html);

    $warr = array( ''=>'입력', 'u'=>'수정', 'r'=>'답변', 'c'=>'코멘트', 'cu'=>'코멘트 수정' );     $str = $warr[$w];

    $subject = '['.$config['cf_title'].'] '.$board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';

    $link_url = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&'.$qstr;

    include_once(G5_LIB_PATH.'/mailer.lib.php');

    ob_start();     include_once ('./write_update_mail.php');     $content = ob_get_contents();     ob_end_clean();

    $array_email = array();     // 게시판관리자에게 보내는 메일     if ($config['cf_email_wr_board_admin']) $array_email[] = $board_admin['mb_email'];     // 게시판그룹관리자에게 보내는 메일     if ($config['cf_email_wr_group_admin']) $array_email[] = $group_admin['mb_email'];     // 최고관리자에게 보내는 메일     if ($config['cf_email_wr_super_admin']) $array_email[] = $super_admin['mb_email'];

    // 원글게시자에게 보내는 메일     if ($config['cf_email_wr_write']) {         if($w == '')             $wr['wr_email'] = $wr_email;

        $array_email[] = $wr['wr_email'];     }

    // 옵션에 메일받기가 체크되어 있고, 게시자의 메일이 있다면     if (strstr($wr['wr_option'], 'mail') && $wr['wr_email'])         $array_email[] = $wr['wr_email'];

    // 중복된 메일 주소는 제거     $unique_email = array_unique($array_email);     $unique_email = array_values($unique_email);     for ($i=0; $i

 

 

mailer.lib.php

 

include_once(G5_PHPMAILER_PATH.'/class.phpmailer.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     }     $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(); }

 

 

config.php

define('G5_PHPMAILER_DIR',  'PHPMailer_v2.0.4');

 

 

class.phpmailer.php

 function Send() {     $header = '';     $body = '';     $result = true;

    if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {       $this->SetError($this->Lang('provide_address'));       return false;     }

    /* Set whether the message is multipart/alternative */     if(!empty($this->AltBody)) {       $this->ContentType = 'multipart/alternative';     }

    $this->error_count = 0; // reset errors     $this->SetMessageType();     $header .= $this->CreateHeader();     $body = $this->CreateBody();

    if($body == '') {       return false;     }

    /* Choose the mailer */     switch($this->Mailer) {       case 'sendmail':         $result = $this->SendmailSend($header, $body);         break;       case 'smtp':         $result = $this->SmtpSend($header, $body);         break;       case 'mail':         $result = $this->MailSend($header, $body);         break;       default:         $result = $this->MailSend($header, $body);         break;         //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));         //$result = false;         //break;     }

    return $result;   }

 

혹시 더 필요한 소스 있으면 올리겠습니다 

 

 

 

 

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

답변 1개

채택된 답변
+20 포인트
검은냥냥이

호스팅사 메일 서버에서 차단된것일 수도 있을것 같습니다. 호스팅 업체에서 현재 이용중인 서버 IP로 OUT 될때 차단되는게 있는지 문의해보세요.

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

답변에 대한 댓글 2개

검은냥냥이
5년 전
서버 아이피로 메일 포트 25번이나 관련 포트로 핑 요청해볼수도 있을것 같긴한데
응답이 없으면 해당 포트가 막힌겁니다.
검은냥냥이
5년 전
https://www.yougetsignal.com/tools/open-ports/

여기서 서버 아이피와 25번 포트 한번 요청해보세요.
closed 라고 나온다면, 포트가 막힌건데요.

우선은 이런식으로 하나씩 확인하면서 범위를 좁혀가야 될듯 싶네요.

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

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

로그인