웹마스터 팁
인증메일 때문에 고생하시는 분 참고하세요.
2010.10.14 02:43
인증메일이 가는곳이 있고 안가는 곳이 있고 그래서
메일 인증을 포기 하신분은 공개 SMTP를 이용한 방법을 참고하시면 좋을 듯합니다.
현재 제 사이트에서는 문제없이 작동하고 있습니다.
core 버전은 1.4.3.1입니다.
일단 메일러를 다운 받습니다.
워낙 유명한거니 아시는 분도 계실겁니다.
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이니 적용하면 가능할 것 같습니다.
테스트는 안해봤는데...필요하신분은 적용해 보세요.
댓글 17
제목 | 글쓴이 | 날짜 |
---|---|---|
Admin 페이지에서 사이트맵 삭제가 안될 때 | FontBox | 2012.10.06 |
회원설정에 레이아웃 설정이 생겼습니다. 회원정보보기페이지 레이아웃 설정 가능 [2] | 똑디 | 2012.10.04 |
youtube, vimeo 자동 썸네일 생성 팁 1.5 이상 [3] | 꿈틀잉 | 2012.09.19 |
iframe 아이프레임 투명처리 | 꿈틀잉 | 2012.10.04 |
실시간 쪽지 [10] | CMD | 2012.09.20 |
제목 부분에 특수키 입력 못하게 막는 방법 [22] | sejin7940 | 2012.09.21 |
[초보팁] 게시판 하단 버튼 정리 [2] | 브레인630 | 2012.09.24 |
UTF-8에서 호환되는 사랑비 BGM 올립니다. [8] | 로로아 | 2008.10.15 |
XE스팸필터 등록 오류(1.5.3.2 적용후) [10] | 정박사닷컴 | 2012.09.11 |
관리자의 회원정보 수정 페이지에 '가입일/최근접속일' 추가하기 [6] | showjean | 2012.09.17 |
iframe을 이용한 악성코드 침투 - 치료 및 대응법 (검블러 or GENO) [8] | 미루819 | 2009.10.01 |
친절한설명! 자신의홈페이지에 간단히 음악넣기 [10] | 준봉쿠 | 2011.12.18 |
인증메일 때문에 고생하시는 분 참고하세요. [17] | 박용식 | 2010.10.14 |
1.4 에서 1.5로 게시판 마이그레이션 팁 [12] | 마음의빈자리 | 2012.07.10 |
DB네임(테이블 프리픽스) 변경 방법 phpmyadmin | 꿈틀잉 | 2012.09.12 |
startssl 에 가입하고 패널 들어갈때 인증서 못받으신분들 | 우리아기 | 2012.09.12 |
인증메일 에러 나시는 분께 드리는 글 | sorigongan | 2012.09.11 |
글 드래그, 오른쪽마우스, 글복사 한번에 막는방법 [6] | 리엔필드 | 2012.06.05 |
iframe 깨는 스크립트 입니다. [4] | HB | 2012.09.01 |
사이트 공사할 때 임시로 다른 페이지 보여주기 | 하늘종 | 2012.09.03 |