메일 contact 문의합니다!

메일 contact 문의합니다!

QA

메일 contact 문의합니다!

본문

contact.php


<?php
include_once('./_common.php');
include_once(G5_THEME_PATH.'/head.php');
?>
<div class="sub_top contact_bg">
 <h2 class="en">Contact</h2>
</div>
</div>
<div class="contact_wrap">
        <div class="container">
            <div class="contact">
               <p class="f40 bold en">CONTACT</p>
                <p class="f16">프로젝트의뢰 및 문의사항이 있으시면 연락주세요.</p>
                <form class="contact_form" name="frm2" method="post" action="contact_mail.php" enctype="multipart/form-data" target="ifrmt" onsubmit="alert('전송완료되었습니다.')">
                    <ul>
                        <li><label for="company" class="hide">회사명</label>
                            <input type="text" id="company" name="company" placeholder="회사명"></li>
                        <li><label for="name" class="hide">이름</label>
                            <input type="text" id="name" name="name" required placeholder="이름"></li>
                        <li><label for="email" class="hide">이메일</label>
                            <input type="text" id="email" name="email" required placeholder="이메일"></li>
                        <li><label for="tel" class="hide">연락처</label>
                            <input type="text" id="tel" name="tel" required placeholder="연락처"></li>
                        <li class="area"><label for="message" class="hide">문의내용</label>
                            <textarea id="message" name="message" required placeholder="문의내용"></textarea></li>
                    </ul>
                    <input type="submit" value="Contact us" id="formbt" class="lt_more">
                    <iframe name="ifrmt"></iframe>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript">
 $('.contact_form').submit(function(){
        $('.contact_form input').val('')
            $('.contact_form textarea').val('')
        })

</script>

<?php
include_once(G5_THEME_PATH.'/tail.php');
?>

 

전송 contact_mail.php


<?php
header("Content-Type: text/html; charset=UTF-8");
 

// Cross-Site Scripting (XSS)을 방지하는 시큐어코딩
// strip_tags() -> 문자열에서 html과 php태그를 제거한다
// htmlspecialchars() -> 특수 문자를 HTML 엔터티로 변환
// 악의적인 특수문자 삽입에 대비하기 위함
$name = strip_tags(htmlspecialchars($_POST['name']));
$email_address = strip_tags(htmlspecialchars($_POST['email']));
$tel = strip_tags(htmlspecialchars($_POST['tel']));
$company = strip_tags(htmlspecialchars($_POST['company']));
$message = strip_tags(htmlspecialchars($_POST['message']));
    
// 이메일을 생성하고 메일을 전송하는 부분
$to = '메일주소'; // 받는 측의 이메일 주소를 기입하는 부분
$email_subject = "메일제목 이름:$name"; // 메일 제목에 해당하는 부분
$email_body = "본 메일은 홈페이지 폼메일로부터 전송된 이메일입니다..\n\n"."세부정보는 다음과 같습니다.\n\n회사명: $company\n\n이름: $name\n\n이메일: $email_address\n\n전화번호: $tel\n\n메세지:\n$message";
$headers = "Reply-To: $email_address\r"; // 답장 주소
 
mail($to,'=?UTF-8?B?'.base64_encode($email_subject).'?=',$email_body,$headers);
return true;            
?>

 

 

예전엔 작동이 잘 되었는데 이제 작동을 안하네요

뭐가 문제일까요 ㅠㅠ

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 465
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT