웹마스터 팁

인증메일이 가는곳이 있고 안가는 곳이 있고 그래서

메일 인증을 포기 하신분은 공개 SMTP를 이용한 방법을 참고하시면 좋을 듯합니다.

 

현재 제 사이트에서는 문제없이 작동하고 있습니다.

core 버전은 1.4.3.1입니다.

(http://www.keyzzler.com)

 

일단 메일러를 다운 받습니다.

워낙 유명한거니 아시는 분도 계실겁니다.

 

http://phpmailer.worxware.com/

위 사이트에서 PHPMailer를 다운 받으세요.

(PHP 버전에 맞춰서 다운 받으세요.)

 

다운 받은 메일러를 XE루드 폴더에 업로드합니다.

 

그리고 classes/mail/Mail.class.php를 수정합니다.

상단에 다음과 같이 넣어줍니다.

(이왕이면 최상단)

 

require_once('PHPMailer/class.phpmailer.php');


 

그리고 send()라는 함수를 찾으셔서 아래와 같이 수정합니다.

 

        function send() {
            $boundary = '----=='.uniqid(rand(),true);
            $this->eol = $GLOBALS['_qmail_compatibility'] == "Y" ? "\n" : "\r\n";

            $this->header = "Content-Type: multipart/alternative;".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol;
            $this->body = sprintf(
                "--%s".$this->eol.
                "Content-Type: text/plain; charset=utf-8; format=flowed".$this->eol.
                "Content-Transfer-Encoding: base64".$this->eol.
                "Content-Disposition: inline".$this->eol.$this->eol.
                "%s".
                "--%s".$this->eol.
                "Content-Type: text/html; charset=utf-8".$this->eol.
                "Content-Transfer-Encoding: base64".$this->eol.
                "Content-Disposition: inline".$this->eol.$this->eol.
                "%s".
                "--%s--".
                "",
                $boundary,
                $this->getPlainContent(),
                $boundary,
                $this->getHTMLContent(),
                $boundary
            );

            $this->procCidAttachments();
            $this->procAttachments();

            $headers = sprintf(
                "From: %s".$this->eol.
                "%s".
                "%s".
                "%s".
                "%s".
                "MIME-Version: 1.0".$this->eol."",
                $this->getSender(),
                $this->messageId?("Message-ID: <".$this->messageId.">".$this->eol):"",
                $this->replyTo?("Reply-To: <".$this->replyTo.">".$this->eol):"",
                $this->bcc?("Bcc: ".$this->bcc.$this->eol):"",
                $this->references?("References: <".$this->references.">".$this->eol."In-Reply-To: <".$this->references.">".$this->eol):""
            );
            $headers .= $this->header;
   //if($this->additional_params) return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers, $this->additional_params);
   //return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers);
   
   $MAILTO = $this->receiptor_email;
   $TITLE = $this->getTitle();
   $BODY = $this->body;
   $HEADER = $headers;
   $HEADER .= "\r\nMIME-Version: 1.0\r\n";
   $HEADER .= "Content-type: text/plain; charset=euc-kr\r\nContent-Transfer-Encoding: 8bit\r\nX-Priority: 1\r\nX-MSMail-Priority: High\r\n";
   $HEADER .= "From: $this->replyTo\r\n" . "Reply-To: $this->replyTo\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\nX-originating-IP: " .$_SERVER['REMOTE_ADDR']. "\r\n";
   
   $mail             = new PHPMailer();
   $mail->addCustomHeader($HEADER);
   $mail->IsSMTP(); // telling the class to use SMTP
   $mail->IsHTML(true);
   $mail->Host       = "yourdomain.com"; // SMTP server
   //$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                // 1 = errors and messages
                // 2 = messages only
   $mail->ContentType="text/plain";
   $mail->CharSet   = "utf-8";
   $mail->SMTPAuth   = true;                  // enable SMTP authentication
   $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
   $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
   $mail->Port       = 465;                   // set the SMTP port for the GMAIL server
   $mail->Username   = "구글 이메일주소";  // GMAIL username
   $mail->Password   = "비밀번호";            // GMAIL password
   
   $mail->SetFrom('구글 이메일주소', '보내는 사람 이름');
   
   $mail->AddReplyTo("답장받을 이메일 주소", "답장받을 사람 이름");
   
   $mail->Subject    = $TITLE;
   
   $mail->AltBody    = $BODY; // optional, comment out and test
   
   $mail->MsgHTML($BODY);
   
   $address = $MAILTO;
   $mail->AddAddress($address, $address);
   
   $mail->Send();

}


메일러 다운받은 곳에가시면 gmail SMTP를 이용한 예제가 있습니다.

이해 안되시는 분은 예제를 참고하시고요...

 

※ 아마 파란(paran.com)도 공개 SMTP이니 적용하면 가능할 것 같습니다.

테스트는 안해봤는데...필요하신분은 적용해 보세요.

제목 글쓴이 날짜
div 세로 중앙 정렬팁 Ansi™ 2014.09.01
카카오톡으로 보내기(깔끔한 뷰) [4] seyriz 2014.08.11
socialXE 에서 로그인시 소셜로그인과 XE 로그인 동시 구현하기 file 큐우우 2014.08.31
XE에 페이스북 소셜 댓글 연동하는 방법 (페이스북 소셜댓글 달기) 기톨닷컴 2014.08.30
카메론 플러그인 에드온이 컨텐츠(본문)을 가릴때 팁 file oscarmike 2014.08.30
게시판의 오늘 올라온 새글의 갯수를 알아내는 방법 [8] garnecia 2014.08.22
캡챠(captcha)가 안 뜰 때 Double'U' 2014.08.29
XE 업데이트 방법 - 제1편 (0.x.x / 1.0.x / 1.1.x / 1.2.x 에서 1.2.4 버전으로 업그레이드) [38] file Gekkou 2009.11.19
XE를 앱으로, 티타늄 및 폰갭(Cordova) 사용기 [1] AJKJ 2014.08.28
익명게시판에서 관리자가 글 수정시 글의 권한이 넘어가지 않도록 하기. [5] 소시덕분에힘받아요 2014.06.11
홈페이지 제작 시, 개인정보관련/회원가입약관 처리에 대해서 [1] 양파F 2014.08.23
관리자 게시판 목록에서 브라우저 제목 클릭시 새창으로 뜨도록 수정 [2] sejin7940 2014.08.26
관리자페이지의 '서버정보출력'에 '절대경로' 가 출력되게 하는 방법 [3] sejin7940 2014.08.26
XE 알림센터 Lite 사용시에 쪽지나 호출에 대해서만 알림음을 적용하기 [17] SeungXE 2014.07.06
사용자 정의를 활용하여 폼 형식으로 개발하는 무식한 방법(2) [5] Reminisce 2014.08.22
사용자 정의를 활용하여 폼 형식으로 개발하는 무식한 방법(1) [6] Reminisce 2014.08.22
CafeXE (homepage 모듈) 메뉴노출 권한오류 수정안. Xiso 2014.08.22
사이트 디자인 설정에서 레이아웃 저장이 안될시 고치는 방법 [1] LoteM대한천자 2014.07.28
스케치북 게시판 메뉴얼 [1] socialskyo 2014.08.21
jquery 이미지 이펙트 플러그인 Ansi™ 2014.08.19