미채택 완료

아이디/비번찾기 이메일 관련 도와주세요ㅠㅠ

2020-01-14 (화) 17:08:49 3,243

/lib/mailer.lib.php

Copy
<?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;

}

?>

기존 ****@도메인주소.com 로 되어있는 부분을

G Suite 메일 계정으로 변경했더니

네이버에서는 이 메일은 [도메인주소]을 통해 발송된 메일이 아닙니다. 라는 의심메시지가 뜨고

지메일에서는 스팸함으로 메일이 수신이 됩니다..

어떤 부분을 수정해줘야할지.. 자세한 답변 부탁드립니다 ..

////////////////

https://sir.kr/pg_tip/13641

위 사이트 정보로 수정하려고 했는데..

전혀 다른 내용으로 되어 있어서

이렇게 수정해도 되는 지 ... 도와주세요 ..

답변 1개 / 댓글 1개

답변에 대한 댓글 1개

참조 주신 것과 다른 방식으로 적용된 거 같아요ㅠ 그래도 답변 감사합니다.

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