diff --git a/d_setting/conf.orig.php b/d_setting/conf.orig.php new file mode 100644 index 00000000..2e6bd170 --- /dev/null +++ b/d_setting/conf.orig.php @@ -0,0 +1,76 @@ +isSMTP(); + $objMail->setFrom($address); + $objMail->Hostname = $host; + $objMail->FromName = $nickname; + $objMail->Port = $port; + + if($checkAuth){ + $objMail->SMTPAuth = true; + $objMail->Username = $user; + $objMail->Password = $password; + + } + if($ignoreCert){ + $objMail->SMTPOptions = array ( + 'ssl' => array( + 'verify_peer' => false, + 'allow_self_signed' => true + ) + ); + } + + if($mailSubType == 'tls'){ + $objMail->SMTPSecure = 'tls'; + } + else if($mailSubType == 'ssl'){ + $objMail->SMTPSecure = 'ssl'; + } + + return $objMail; + } + else if($mailType == 'mail'){ + throw new BadMethodCallException('Not Implemented'); + } + else if($mailType == 'google'){ + throw new BadMethodCallException('Not Implemented'); + } + else{ + throw new InvalidArgumentException('Invalid Mail Type'); + } + + + + + +} \ No newline at end of file diff --git a/f_config/MAIL.php b/f_config/MAIL.php index 9ababf2d..e056c4b9 100644 --- a/f_config/MAIL.php +++ b/f_config/MAIL.php @@ -4,7 +4,7 @@ require_once(ROOT.W.F_FUNC.W.'class._Mail.php'); require_once(ROOT.W.F_CONFIG.W.SETTING.PHP); if($SETTING->IsExist()) { - $MAIL = new _Mail($SETTING->MailHost(), $SETTING->MailPort(), $SETTING->MailId(), $SETTING->MailPw(), $SETTING->MailAddr()); + $MAIL = new _Mail(); } else { Error('설정 파일이 없습니다. 설정을 먼저 하십시요!'); } diff --git a/f_func/class._Mail.php b/f_func/class._Mail.php index 33982ff9..4f3203e3 100644 --- a/f_func/class._Mail.php +++ b/f_func/class._Mail.php @@ -1,30 +1,15 @@ objMail = new PHPMailer(); - $this->objMail->IsSMTP(); - $this->objMail->SMTPAuth = false; - //$this->objMail->SMTPSecure = 'ssl';//TODO 제대로된 Mailer 옵션 설정 - $this->objMail->Host = $host; - $this->objMail->Port = $port; - $this->objMail->Username = $id; - $this->objMail->Password = $pw; + public function __construct() { + $this->objMail = newMailObj(); $this->objMail->ContentType = 'text/plain'; $this->objMail->CharSet = 'utf-8'; $this->objMail->Encoding = 'base64'; - $this->objMail->SetFrom($addr); - $this->objMail->SMTPOptions = array ( - 'ssl' => array( - 'verify_peer' => false, - 'allow_self_signed' => true - ) - ); } public function Send($to, $subject, $content) { diff --git a/twe/d_setting/conf.orig.php b/twe/d_setting/conf.orig.php new file mode 100644 index 00000000..51dca3a5 --- /dev/null +++ b/twe/d_setting/conf.orig.php @@ -0,0 +1,13 @@ +