AvocadoAmber/AvocadoEdition_Light/bbs/formmail_send.php

59 lines
1.7 KiB
PHP
Raw Normal View History

2022-09-17 20:50:50 +09:00
<?php
include_once('./_common.php');
2024-09-19 20:57:39 +09:00
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
include_once(G5_LIB_PATH . '/mailer.lib.php');
2022-09-17 20:50:50 +09:00
if (!$config['cf_email_use'])
2024-09-19 20:57:39 +09:00
alert('환경설정에서 "메일발송 사용"에 체크하셔야 메일을 발송할 수 있습니다.\\n\\n관리자에게 문의하시기 바랍니다.');
2022-09-17 20:50:50 +09:00
if (!$is_member && $config['cf_formmail_is_member'])
2024-09-19 20:57:39 +09:00
alert_close('회원만 이용하실 수 있습니다.');
2022-09-17 20:50:50 +09:00
$email_enc = new str_encrypt();
$to = $email_enc->decrypt($to);
if (substr_count($to, "@") > 1)
2024-09-19 20:57:39 +09:00
alert_close('한번에 한사람에게만 메일을 발송할 수 있습니다.');
2022-09-17 20:50:50 +09:00
if (!chk_captcha()) {
2024-09-19 20:57:39 +09:00
alert('자동등록방지 숫자가 틀렸습니다.');
2022-09-17 20:50:50 +09:00
}
2024-09-23 09:37:13 +09:00
$file = [];
2024-09-19 20:57:39 +09:00
for ($i = 1; $i <= $attach; $i++) {
if ($_FILES['file' . $i]['name'])
$file[] = attach_file($_FILES['file' . $i]['name'], $_FILES['file' . $i]['tmp_name']);
2022-09-17 20:50:50 +09:00
}
$content = stripslashes($content);
if ($type == 2) {
2024-09-19 20:57:39 +09:00
$type = 1;
$content = str_replace("\n", "<br>", $content);
2022-09-17 20:50:50 +09:00
}
// html 이면
if ($type) {
2024-09-19 20:57:39 +09:00
$current_url = G5_URL;
$mail_content = '<!doctype html><html lang="ko"><head><meta charset="utf-8"><title>메일보내기</title><link rel="stylesheet" href="' . $current_url . '/style.css"></head><body>' . $content . '</body></html>';
} else
$mail_content = $content;
2022-09-17 20:50:50 +09:00
mailer($fnick, $fmail, $to, $subject, $mail_content, $type, $file);
// 임시 첨부파일 삭제
2024-09-19 20:57:39 +09:00
if (!empty($file)) {
foreach ($file as $f) {
@unlink($f['path']);
}
2022-09-17 20:50:50 +09:00
}
//$html_title = $tmp_to . "님께 메일발송";
$html_title = '메일 발송중';
2024-09-19 20:57:39 +09:00
include_once(G5_PATH . '/head.sub.php');
2022-09-17 20:50:50 +09:00
alert_close('메일을 정상적으로 발송하였습니다.');
2024-09-19 20:57:39 +09:00
include_once(G5_PATH . '/tail.sub.php');