웹마스터 팁

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

메일 인증을 포기 하신분은 공개 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이니 적용하면 가능할 것 같습니다.

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

제목 글쓴이 날짜
IE를 제외한 브라우저에서 첨부파일이 100%에서 사라지는 증세의 해결 [2] 비나무 2010.10.03
PHP 5.3.X 버전 사용자들 중 XE 최신버전의 위젯 생성, 텍스타일 등에서의 에러날 때... 비나무 2010.10.03
1.4.4.1 업데이트이후 이미지가 엑스박스로 뜨는 분들 참고 [1] 위드파트너 2010.10.04
크로스 브라우징을 위한 css 초기화 [2] hhgyu 2010.10.05
큰 사이즈의 이미지 업로드시 섬네일 생성이 안되어 오류 발생하는 문제 예방법 도라란 2010.10.05
광고성 글때문에.... 금지 ip 목록 공유 [5] 한니발2 2010.10.06
댓글을 리스트에 출력하기 [1] 김성걸310 2010.10.07
나눔고딕 웹폰트가 아닌 API로 적용하여 사용해보자!! [10] 으아악. 2010.10.07
카페24 외부페이지로 트래픽 확인하기 [1] file teryboy 2010.10.09
XE에서 설문조사시 비회원 참여하는 방법 있을까요? [1] file hellosamyoo 2010.10.12
이미지 삽입시 아래에 한줄 띄우고 클릭가능하게 하여 편히 입력하게 만들자~ [8] file xemall 2010.10.13
IE6부터 IE9까지 대응하기. [7] 정찬명 2010.10.13
플래시를 이용한 최근게시물 구현 [6] 한그림 2010.10.13
인증메일 때문에 고생하시는 분 참고하세요. [17] 박용식 2010.10.14
페이지 설정, 꼭 이렇게 해두세요 [10] file 老姜君 2010.10.14
에디터에 웹폰트를 추가하여 사용하기 [3] file 하얌이 2010.10.18
게시판에 구글 SyntaxHighlighter 3.0.83(구문강조) 적용하기 - 본문에 코드삽입시 유용 file 으아악. 2010.10.20
큐브리드로 변환후 인덱스 재생성 [1] 카르마 2010.10.22
스팸단어목록 공유 [3] 쁘띠하긔 2010.10.23
Mysql에서 큐브리드로 데이터이전 [3] 카르마 2010.10.23