sfp 를 수정하여도 네이버 웍스를 하여도 메일서버가 없어 안될 경우에 대해 간단한 방법을 알려드립니다.
저도 얼마전까지 됐다가 안되길래 이 방법을 하니 잘 되기에 공유 하고자 합니다.
일단 그누보드가 설치된 루트 폴더에 config.php를 열고
// SMTP
// lib/mailer.lib.php 에서 사용
//define('G5_SMTP', '127.0.0.1');
define('G5_SMTP', 'smtp.works.naver.com');
로 교체를 한후(smtp.works.naver.com 부분은 구글로 해도 되고 사용하고자 하는 smtp로 수정)
그런 다음 lib 폴더로 이동하여 mailer.lib.php 파일에서 로 수정하면 됩니다.
이 파일은 http://sir.co.kr/bbs/board.php?bo_table=g5_tip&wr_id=1881 여기에서 살짝 수정만 했습니다.
try
{
$mail->Host = "For_Abuser"; // 예외를 고려하여, Host 명을 임의의 값으로 설정함.
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
if (defined('G5_SMTP')) {
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = G5_SMTP; // SMTP server. 루트 디렉토리의 config.php 에서, define('G5_SMTP', 'dsmtp.naver.com') 로 설정되어 있는 값을 끌어옴.
$mail->Port = 465; // SMTP 포트
}
//$mail->SMTPDebug = 2; // enables SMTP debug information, 오류 메시지를 보기 위해서는 주석을 해제하고 2 로 설정할 것. 오류 메시지는 "회원메일발송 > 테스트" 버튼을 실행했을 때에만 나타남.
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Username = $fmail;
$mail->CharSet = "UTF-8"; // class.phpmailer.php 의 기본값이 iso-8859-1 이므로, UTF-8 로 변경함.
$mail->Username = "메일계정"; // 계정 아이디
$mail->Password = "계정 암호"; // 계정 암호
$mail->Encoding = "base64"; // 기본값이 8bit 이므로, base64로 변경함.
$mail->SetFrom("$fmail", '운영자');
$mail->AddReplyTo("$fmail", '운영자');
$mail->AddAddress($to); // 수신자
$mail->Subject = $subject; // 제목
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($content);
저도 얼마전까지 됐다가 안되길래 이 방법을 하니 잘 되기에 공유 하고자 합니다.
일단 그누보드가 설치된 루트 폴더에 config.php를 열고
// SMTP
// lib/mailer.lib.php 에서 사용
//define('G5_SMTP', '127.0.0.1');
define('G5_SMTP', 'smtp.works.naver.com');
로 교체를 한후(smtp.works.naver.com 부분은 구글로 해도 되고 사용하고자 하는 smtp로 수정)
그런 다음 lib 폴더로 이동하여 mailer.lib.php 파일에서 로 수정하면 됩니다.
이 파일은 http://sir.co.kr/bbs/board.php?bo_table=g5_tip&wr_id=1881 여기에서 살짝 수정만 했습니다.
try
{
$mail->Host = "For_Abuser"; // 예외를 고려하여, Host 명을 임의의 값으로 설정함.
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
if (defined('G5_SMTP')) {
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = G5_SMTP; // SMTP server. 루트 디렉토리의 config.php 에서, define('G5_SMTP', 'dsmtp.naver.com') 로 설정되어 있는 값을 끌어옴.
$mail->Port = 465; // SMTP 포트
}
//$mail->SMTPDebug = 2; // enables SMTP debug information, 오류 메시지를 보기 위해서는 주석을 해제하고 2 로 설정할 것. 오류 메시지는 "회원메일발송 > 테스트" 버튼을 실행했을 때에만 나타남.
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Username = $fmail;
$mail->CharSet = "UTF-8"; // class.phpmailer.php 의 기본값이 iso-8859-1 이므로, UTF-8 로 변경함.
$mail->Username = "메일계정"; // 계정 아이디
$mail->Password = "계정 암호"; // 계정 암호
$mail->Encoding = "base64"; // 기본값이 8bit 이므로, base64로 변경함.
$mail->SetFrom("$fmail", '운영자');
$mail->AddReplyTo("$fmail", '운영자');
$mail->AddAddress($to); // 수신자
$mail->Subject = $subject; // 제목
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($content);
댓글 10개
게시글 목록
| 번호 | 제목 |
|---|---|
| 24318 | |
| 24317 | |
| 24315 | |
| 24309 | |
| 24294 | |
| 24293 | |
| 24277 | |
| 24262 | |
| 24260 | |
| 24253 | |
| 24251 | |
| 24236 | |
| 24233 | |
| 24228 | |
| 24226 | |
| 24221 | |
| 24214 | |
| 24203 | |
| 24201 | |
| 24199 | |
| 24196 | |
| 24195 | |
| 24194 | |
| 24192 | |
| 24191 | |
| 24187 | |
| 24185 | |
| 24183 | |
| 24172 | |
| 24168 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기