Copy
<?phpif (!defined('_GNUBOARD_')) exit;include_once(G5_PHPMAILER_PATH.'/PHPMailerAutoload.php');// 메일 보내기 (파일 여러개 첨부 가능)// type : text=0, html=1, text+html=2function 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; } $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();}// 파일을 첨부함function attach_file($filename, $tmp_name){ // 서버에 업로드 되는 파일은 확장자를 주지 않는다. (보안 취약점) $dest_file = G5_DATA_PATH.'/tmp/'.str_replace('/', '_', $tmp_name); move_uploaded_file($tmp_name, $dest_file); $tmpfile = array("name" => $filename, "path" => $dest_file); return $tmpfile;}?>
여기서 뭐가 문제인거죠?
네이버로 시도해봤는데 안되길레 원래대로 돌려놨어요
답변 2개 / 댓글 2개
채택된 답변
+20 포인트
2017-08-09 (수) 21:15:20
Sendmail 서버와 같은 류의 메일 보내기 서버를 따로 설치를 해야 전달이 될듯 싶네요..
답변에 대한 댓글 1개
2017-08-09 (수) 21:11:27
질문으로 출력한 소스는 그누보드 메일 라이브러리 함수 아닌가요?
별문제없이 메일 잘 도착하는 소스인데요?
저 함수를 어떻게 사용해서 메일을 보냈는지는 모르겠지만요.
사용자분의 서버나 서비스를 받고 있는 웹호스팅에 메일보내기 서버가 설치돼 있으면 메일 전달될듯 싶네요..
답변에 대한 댓글 1개
Korharu
2017-08-09 (수) 21:13:19
그럼 XAMPP로 만든 사이트로는 안되는건가요...
XAMPP 설치때 FAKE SENDMAIL이라는 프로그램도 깔리던데요///
XAMPP 설치때 FAKE SENDMAIL이라는 프로그램도 깔리던데요///
답변을 작성하려면 로그인이 필요합니다.