그누보드 게시글 작성시 메일 전송
본문
메일로 보내지는 것까지는 완료가 됐는데, 내용 출력이 안돼요..
wr_1, wr_2 등 전부 출력되게 하고싶은데 content 내용만 출력이 되네요
$mail->msgHTML($content); 이 부분을 수정해야 되는 것 같은데,
여러 내용을 어떻게 출력해야 될까요?
mailer.lib.php
<?php
if (!defined('_GNUBOARD_')) exit;
include_once(G5_PHPMAILER_PATH.'/PHPMailerAutoload.php');
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
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;
}
$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;
}
?>
write.skin.php
<div class="tbl_frm01 tbl_wrap">
<table style="visibility:collapse">
<tr style="visibility:collapse">
<td colspan="2">
<div id="autosave_wrapper">
<input type="text" name="wr_subject" value="견적문의" id="wr_subject" required class="frm_input required" size="50" maxlength="255">
<?php if ($is_member) { // 임시 저장된 글 기능 ?>
<script src="<?php echo G5_JS_URL; ?>/autosave.js"></script>
<?php if($editor_content_js) echo $editor_content_js; ?>
</div>
<?php } ?>
</td>
</tr>
<tr >
<th scope="row"><label for="wr_content">문의내용<strong class="sound_only">필수</strong></label></th>
<td class="wr_content">
</td>
</tr>
</table>
<p class="form_title">02. 기본 정보를 입력해 주세요.</p>
<ul>
<li>
<label for="wr_name">회사명<strong class="sound_only">필수</strong></label><br>
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_name">회사명<strong class="sound_only">필수</strong></label><br>
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_1">담당자명 / 직책(wr_1)</label><br>
<input type="text" name="wr_1" value="<?php echo $name ?>" id="wr_1" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_2">담당자명 / 직책 (wr_2)</label><br>
<input type="text" name="wr_2" value="<?php echo $name ?>" id="wr_2" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_3">연락처(wr_3)</label><br>
<input type="text" name="wr_3" value="<?php echo $name ?>" id="wr_3" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_4">연락처(wr_4)</label><br>
<input type="text" name="wr_4" value="<?php echo $name ?>" id="wr_4" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_5">연락처(wr_5)</label><br>
<input type="text" name="wr_5" value="<?php echo $name ?>" id="wr_5" required class="frm_input required" size="20" maxlength="20">
</li>
<li>
<label for="wr_6">연락처(wr_6)</label><br>
<input type="text" name="wr_6" value="<?php echo $name ?>" id="wr_6" required class="frm_input required" size="20" maxlength="20">
</li>
</ul>
</div>
write_update.skin.php
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/mailer.lib.php');
$tosem1="@naver.com";
$wr_email="*** 개인정보보호를 위한 이메일주소 노출방지 ***";
mailer($wr_name, $wr_email, $tosem1, $wr_subject, $content, $wr_1, 1);
$wr_8 = "$wr8[0]|$wr8[1]|$wr8[2]|$wr8[3]|$wr8[4]|$wr8[5]|$wr8[6]|$wr8[7]|$wr8[8]|$wr8[9]|$wr8[10]|$wr8[11]|$wr8[12]|$wr8[13]|$wr8[14]|$wr8[15]";
sql_query(" update $write_table set wr_8 = '$wr_8' where wr_id = '$wr_id' ");
alert('문의가 정상적으로 접수되었습니다.', G5_HTTP_BBS_URL.'/write.php?bo_table='.$bo_table);
?>
!-->!-->!-->
답변을 작성하시기 전에 로그인 해주세요.