먼저, 그누보드를 개발 및 공개해 주시는 에스아이알소프트에 진심으로 감사의 말씀을 전합니다.
그누보드 G4S(현 G5베타)에서 메일 보내기가 잘 안되시는 분들이 참고하시면 도움이 될 듯 합니다. 기존 mailer 함수(PHPMailer 직전에 사용되었던 소스)에서는 GMail 에서 본문이 잘리는 문제가 있었습니다.
* plugin/PHPMailer_v2.0.4 는 사용하지 않음. 폴더 전체를 삭제함.
* 최신판인 PHPMailer 5.2.7 로 대체함. (http://phpmailer.worxware.com/index.php)
* 필요한 파일: 세개의 파일만 있으면 됨. (class.phpmailer.php, class.smtp.php, PHPMailerAutoload.php)
* 위의 세 파일을 adm/ 폴더 안에 배치하고, 기존 plugin/PHPMailer_v2.0.4 폴더는 삭제함.
* 세 파일 각각 상단에,
if (!defined('_GNUBOARD_')) exit;
코드를 추가.
* 네이버 메일(네이버 Works)을 smtp 로 이용하여, 이메일 발송용으로 사용.
* 자체 서버에는 메일 수발신용 소프트웨어(예: sendmail)를 설치하지 않고, 오로지 smtp 발송용 소프트웨어만 설치한 상태임. 물론 sendmail 로 링크된 상태임.
* 참고한 소스 : http://phpmailer.worxware.com/index.php?pg=exampleagmail
* 변경한 파일: lib/mailer.lib.php
<<< mailer.lib.php >>>
<?php
if (!defined('_GNUBOARD_')) exit;
include_once(G4_ADMIN_PATH.'/class.phpmailer.php'); // adm 폴더 안으로 class.phpmailer.php 를 배치한 예제임.
include_once(G4_ADMIN_PATH.'/class.smtp.php'); // adm 폴더 안으로 class.smtp.php 를 배치한 예제임.
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g4;
// 메일발송 사용을 하지 않는다면
if (!$config['cf_email_use']) return;
if ($type != 1)
$content = nl2br($content);
///// 아래는 네이버 Works 를 사용했을 때의 설정 예제임. http://mail.naver.com/external/naverworks
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('G4_SMTP')) {
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = G4_SMTP; // SMTP server. 루트 디렉토리의 config.php 에서, define('G4_SMTP', 'dsmtp.naver.com') 로 설정되어 있는 값을 끌어옴.
$mail->Port = 587; // 네이버 SMTP 포트
}
//$mail->SMTPDebug = 2; // enables SMTP debug information, 오류 메시지를 보기 위해서는 주석을 해제하고 2 로 설정할 것. 오류 메시지는 "회원메일발송 > 테스트" 버튼을 실행했을 때에만 나타남.
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Username = $fmail;
$mail->Password = "비밀번호";
$mail->CharSet = "UTF-8"; // class.phpmailer.php 의 기본값이 iso-8859-1 이므로, UTF-8 로 변경함.
$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);
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']);
}
}
if($mail->Send())
{
$message = "메일을 발송했습니다.<p></p>\n";
return true;
}
}
catch(phpmailerException $e)
{
$error = $e->errorMessage(); //Pretty error messages from PHPMailer
return false;
}
catch (Exception $e)
{
$error = $e->getMessage(); //Boring error messages from anything else!
return false;
}
return false;
}
?>
그누보드 G4S(현 G5베타)에서 메일 보내기가 잘 안되시는 분들이 참고하시면 도움이 될 듯 합니다. 기존 mailer 함수(PHPMailer 직전에 사용되었던 소스)에서는 GMail 에서 본문이 잘리는 문제가 있었습니다.
* plugin/PHPMailer_v2.0.4 는 사용하지 않음. 폴더 전체를 삭제함.
* 최신판인 PHPMailer 5.2.7 로 대체함. (http://phpmailer.worxware.com/index.php)
* 필요한 파일: 세개의 파일만 있으면 됨. (class.phpmailer.php, class.smtp.php, PHPMailerAutoload.php)
* 위의 세 파일을 adm/ 폴더 안에 배치하고, 기존 plugin/PHPMailer_v2.0.4 폴더는 삭제함.
* 세 파일 각각 상단에,
if (!defined('_GNUBOARD_')) exit;
코드를 추가.
* 네이버 메일(네이버 Works)을 smtp 로 이용하여, 이메일 발송용으로 사용.
* 자체 서버에는 메일 수발신용 소프트웨어(예: sendmail)를 설치하지 않고, 오로지 smtp 발송용 소프트웨어만 설치한 상태임. 물론 sendmail 로 링크된 상태임.
* 참고한 소스 : http://phpmailer.worxware.com/index.php?pg=exampleagmail
* 변경한 파일: lib/mailer.lib.php
<<< mailer.lib.php >>>
<?php
if (!defined('_GNUBOARD_')) exit;
include_once(G4_ADMIN_PATH.'/class.phpmailer.php'); // adm 폴더 안으로 class.phpmailer.php 를 배치한 예제임.
include_once(G4_ADMIN_PATH.'/class.smtp.php'); // adm 폴더 안으로 class.smtp.php 를 배치한 예제임.
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g4;
// 메일발송 사용을 하지 않는다면
if (!$config['cf_email_use']) return;
if ($type != 1)
$content = nl2br($content);
///// 아래는 네이버 Works 를 사용했을 때의 설정 예제임. http://mail.naver.com/external/naverworks
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('G4_SMTP')) {
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = G4_SMTP; // SMTP server. 루트 디렉토리의 config.php 에서, define('G4_SMTP', 'dsmtp.naver.com') 로 설정되어 있는 값을 끌어옴.
$mail->Port = 587; // 네이버 SMTP 포트
}
//$mail->SMTPDebug = 2; // enables SMTP debug information, 오류 메시지를 보기 위해서는 주석을 해제하고 2 로 설정할 것. 오류 메시지는 "회원메일발송 > 테스트" 버튼을 실행했을 때에만 나타남.
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Username = $fmail;
$mail->Password = "비밀번호";
$mail->CharSet = "UTF-8"; // class.phpmailer.php 의 기본값이 iso-8859-1 이므로, UTF-8 로 변경함.
$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);
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']);
}
}
if($mail->Send())
{
$message = "메일을 발송했습니다.<p></p>\n";
return true;
}
}
catch(phpmailerException $e)
{
$error = $e->errorMessage(); //Pretty error messages from PHPMailer
return false;
}
catch (Exception $e)
{
$error = $e->getMessage(); //Boring error messages from anything else!
return false;
}
return false;
}
?>
댓글 8개
오로지 smtp 발송용 소프트웨어만 설치한 상태임. 물론 sendmail 로 링크된 상태임.
-> 이 말씀의 의미를 좀 설명부탁드릴께요. 워낙 잘 몰라서.... (설명해주신대로 따라한다고 해봤는데... 안되더라구요)
G5beta 5.0b20 버전으로 업데이트 된 상태이구요.
지금 최신 버전에서는 mailer.lib.php 의 내용이 위에 붙여주신 코드와는 좀 많이 다른데요...
G5beta 5.0b20 버전에서도 가능할지... 그리고 가능하다면 어떻게 해야할지.. 좀 부탁드려도 될까요?
저는 sendmail이 설치되어 있는 상태입니다.
-> 이 말씀의 의미를 좀 설명부탁드릴께요. 워낙 잘 몰라서.... (설명해주신대로 따라한다고 해봤는데... 안되더라구요)
G5beta 5.0b20 버전으로 업데이트 된 상태이구요.
지금 최신 버전에서는 mailer.lib.php 의 내용이 위에 붙여주신 코드와는 좀 많이 다른데요...
G5beta 5.0b20 버전에서도 가능할지... 그리고 가능하다면 어떻게 해야할지.. 좀 부탁드려도 될까요?
저는 sendmail이 설치되어 있는 상태입니다.
도움 요청 합니다
요즘 아래와같은 메일이 대량으로전송되고 있어 구글에서 일일메일 발송제한되고 있습니다
해결방법을 아시는분은 리플요청 합니다
=================발송자가 상이하게다량메일발송 합니다 ==========
Delivery to the following recipient failed permanently:
nabilof07@gmail.com
Technical details of permanent failure:
Message rejected. See https://support.google.com/mail/answer/69585 for more information.
----- Original message -----
X-Received: by 10.66.156.226 with SMTP id wh2mr26820054pab.116.1472735024403;
Thu, 01 Sep 2016 06:03:44 -0700 (PDT)
Return-Path: <shimsshome@gmail.com>
Received: from shimss.ipdisk.co.kr ([221.140.118.152])
by smtp.gmail.com with ESMTPSA id b68sm7656488pfg.85.2016.09.01.06.03.41
for <nabilof07@gmail.com>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 01 Sep 2016 06:03:43 -0700 (PDT)
From: Lena Yates <shimsshome@gmail.com>
X-Google-Original-From: Lena Yates <lena_yates@shimss.ipdisk.co.kr>
Date: Sun, 28 Aug 2016 21:08:15 +0900
To: nabilof07@gmail.com
Subject: Sxx Tonight
Message-ID: <8797ef987300723e60c71c3169386e03@shimss.ipdisk.co.kr>
X-Priority: 3
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_8797ef987300723e60c71c3169386e03"
Content-Transfer-Encoding: 8bit
We can (um together tonight!
I feel that my life is daily repeating itself, give me a fresh breath!
I will show you my repertoire of 0ral sxx!
[ http://ghalamrang.com/plugin.php?j=114&nMo3Xdv7u9uyn3HH=Dka&9Az=7w7&4G9G=Ti ] These pics will be a good start
요즘 아래와같은 메일이 대량으로전송되고 있어 구글에서 일일메일 발송제한되고 있습니다
해결방법을 아시는분은 리플요청 합니다
=================발송자가 상이하게다량메일발송 합니다 ==========
Delivery to the following recipient failed permanently:
nabilof07@gmail.com
Technical details of permanent failure:
Message rejected. See https://support.google.com/mail/answer/69585 for more information.
----- Original message -----
X-Received: by 10.66.156.226 with SMTP id wh2mr26820054pab.116.1472735024403;
Thu, 01 Sep 2016 06:03:44 -0700 (PDT)
Return-Path: <shimsshome@gmail.com>
Received: from shimss.ipdisk.co.kr ([221.140.118.152])
by smtp.gmail.com with ESMTPSA id b68sm7656488pfg.85.2016.09.01.06.03.41
for <nabilof07@gmail.com>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 01 Sep 2016 06:03:43 -0700 (PDT)
From: Lena Yates <shimsshome@gmail.com>
X-Google-Original-From: Lena Yates <lena_yates@shimss.ipdisk.co.kr>
Date: Sun, 28 Aug 2016 21:08:15 +0900
To: nabilof07@gmail.com
Subject: Sxx Tonight
Message-ID: <8797ef987300723e60c71c3169386e03@shimss.ipdisk.co.kr>
X-Priority: 3
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_8797ef987300723e60c71c3169386e03"
Content-Transfer-Encoding: 8bit
We can (um together tonight!
I feel that my life is daily repeating itself, give me a fresh breath!
I will show you my repertoire of 0ral sxx!
[ http://ghalamrang.com/plugin.php?j=114&nMo3Xdv7u9uyn3HH=Dka&9Az=7w7&4G9G=Ti ] These pics will be a good start
게시글 목록
| 번호 | 제목 |
|---|---|
| 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 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기