채택완료

게시판 글작성시 내용을 이메일로 보내기 문의

2017-03-28 (화) 12:39:08 6,368

안녕하세요.

문의게시판을 만들고있는데

게시판 폼값의 내용을 그대로 이메일로도 전송하려합니다.

write.update.skin.php 파일에서 메일 폼을 작성중인데요.

Copy
<!doctype html><html><head><meta charset="utf-8"><title>폼메일보내기</title><style>table {width:100%;border:1px solid #C4C4C4;border-collapse: collapse;}th {width:20%;border:1px solid #c4c4c4;background:#ebebeb;color:#383838;text-align:center;font-size:1.083em;}td {border:1px solid #dfdfdf;padding:17px 5px;font-size:1.083em;color:#666}btn_submit {border-radius:3px;background:#3c95d5;border:1px solid #3c95d5;padding:10px 20px;font-size:1.083em}</style></head><body>      <div>        <table>        <tbody>        <tr>            <th scope="row"><label for="wr_name">이름</label></th>            <td><input type="text" value="<?php echo $wr_name ?>" readonly size="10" maxlength="20"></td>        </tr>                <tr>            <th scope="row"><label for="wr_1">회사명</label></th>            <td><input type="text" value="<?php echo $wr_1 ?>" readonly size="10" maxlength="20"></td>        </tr>                <tr>            <th scope="row"><label for="wr_2">부서</label></th>            <td><input type="text" value="<?php echo $wr_2 ?>" readonly size="10" maxlength="20"></td>        </tr>                <tr>            <th scope="row"><label for="wr_3">직위</label></th>            <td><input type="text" value="<?php echo $wr_3 ?>" readonly size="10" maxlength="20"></td>        </tr>            <tr>            <th scope="row"><label for="wr_4">전화번호</label></th>            <td><input type="text" value="<?php echo $wr_4 ?>" readonly size="15" maxlength="20"> 내선번호<input type="text" value="<?php echo $write['wr_5'] ?>" id="wr_5" readonly size="15" maxlength="20"></td>        </tr>                <tr>            <th scope="row"><label for="wr_6">휴대폰</label></th>            <td><input type="text" value="<?php echo $wr_5 ?>" readonly size="20" maxlength="30"></td>        </tr>        <tr>            <th scope="row"><label for="wr_email">이메일</label></th>            <td><input type="text" value="<?php echo $wr_email ?>" readonly size="50" maxlength="100"></td>        </tr>        <tr>            <th scope="row"><label for="wr_homepage">홈페이지</label></th>            <td><input type="text" value="<?php echo $wr_homepage ?>" readonly size="50"></td>        </tr></tbody></table></div></body></html>

위 폼을 메일로 보내려면

write.update.skin.php 파일에서 폼하고 send 코드를 같이 넣어야할까요?..

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트
2017-03-28 (화) 12:51:15

/bbs/write_update.php

Copy
// 메일발송 사용 (수정글은 발송하지 않음)if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_email']) {    // 관리자의 정보를 얻고    $super_admin = get_admin('super');    $group_admin = get_admin('group');    $board_admin = get_admin('board');    $wr_subject = get_text(stripslashes($wr_subject));    $tmp_html = 0;    if (strstr($html, 'html1'))        $tmp_html = 1;    else if (strstr($html, 'html2'))        $tmp_html = 2;    $wr_content = conv_content(conv_unescape_nl(stripslashes($wr_content)), $tmp_html);    $warr = array( ''=>'입력', 'u'=>'수정', 'r'=>'답변', 'c'=>'코멘트', 'cu'=>'코멘트 수정' );    $str = $warr[$w];    $subject = '['.$config['cf_title'].'] '.$board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';    $link_url = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;'.$qstr;    include_once(G5_LIB_PATH.'/mailer.lib.php');    ob_start();    include_once ('./write_update_mail.php');    $content = ob_get_contents();    ob_end_clean();    $array_email = array();    // 게시판관리자에게 보내는 메일    if ($config['cf_email_wr_board_admin']) $array_email[] = $board_admin['mb_email'];    // 게시판그룹관리자에게 보내는 메일    if ($config['cf_email_wr_group_admin']) $array_email[] = $group_admin['mb_email'];    // 최고관리자에게 보내는 메일    if ($config['cf_email_wr_super_admin']) $array_email[] = $super_admin['mb_email'];    // 원글게시자에게 보내는 메일    if ($config['cf_email_wr_write']) {        if($w == '')            $wr['wr_email'] = $wr_email;        $array_email[] = $wr['wr_email'];    }    // 옵션에 메일받기가 체크되어 있고, 게시자의 메일이 있다면    if (strstr($wr['wr_option'], 'mail') && $wr['wr_email'])        $array_email[] = $wr['wr_email'];    // 중복된 메일 주소는 제거    $unique_email = array_unique($array_email);    $unique_email = array_values($unique_email);    for ($i=0; $i<count($unique_email); $i++) {        mailer($wr_name, $wr_email, $unique_email[$i], $subject, $content, 1);    }}// 사용자 코드 실행@include_once($board_skin_path.'/write_update.skin.php');

해당 소스 보시면 include_once ('./write_update_mail.php'); 로 메일 전송 폼을 발송하게 됩니다.

/bbs/write_update_mail.php 열어 보시면 이해가 되지 싶습니다.

님께서 만들고 계신 스킨파일(write_update.skin.php)도 아래 사용자 코드 실행에 보시면 보이실 겁니다.

기본 기능과 별도로 처리를 원하신다면 해당 소스 부분을 스킨 안에 넣고 돌리시면 될겁니다.

단 원하시는 폼 변경 및 경로 설정은 잘 하셔야 할겁니다. 

답변에 대한 댓글 1개

감사합니다^^
조언해주신내용 참고해서 조금 헤메긴하였으나 기능구현이 됬네요^^

답변을 작성하려면 로그인이 필요합니다.