답변 2개
5년 전
관리자 이메일이 네이버면 naver가 제공하는 smtp로 메일 보내면 됩니다. 다음과 같이 mailer함수를 재정의 합니다.
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g5;
// 메일발송 사용을 하지 않는다면
if (!$config['cf_email_use']) return;
if ($type != 1)
$content = nl2br($content);
$mail = new PHPMailer(); // defaults to using php "mail()"
if (defined('G5_SMTP') && G5_SMTP) {
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = G5_SMTP; // SMTP server
if(defined('G5_SMTP_PORT') && G5_SMTP_PORT)
$mail->Port = G5_SMTP_PORT;
}
//@관리자 스팜 처리 안되게
if($fmail == 'xxxx_id@naver.com') {
$mail->Host = 'smtp.naver.com';
$mail->Port = 465;
$mail->Username = 'xxxx_id';
$mail->Password = 'xxxx_password';
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
}
$mail->CharSet = 'UTF-8';
$mail->From = $fmail;
$mail->FromName = $fname;
$mail->Subject = $subject;
$mail->AltBody = ""; // optional, comment out and test
$mail->msgHTML($content);
$mail->addAddress($to);
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']);
}
}
return $mail->send();
}
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
광깔
5년 전
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
이경우 smtp.pushnews.io 라고 적어주면 될까요??
그런데 위 소스는 어느 페이지에 적어줘야 하는 건가요 ???