테스트 사이트 - 개발 중인 베타 버전입니다

지메일로 폼메일 수신이 안되는 이유? 채택완료

김태후니 2년 전 조회 2,238

</p>

<p><form name="contactform" method="post" action="send.php">

                    <input type="hidden" name="이메일" value="이메일 주소가 입력되어있습니다." />

                    <table>

                        <tr>

                            <th>성명</th>

                            <td><input type='text' name="user_name" id="user_name" placeholder="성함을 입력해주세요." autocomplete="off" /></td>

                        </tr>

                        <tr>

                            <th>핸드폰 번호</th>

                            <td><input type='tel' name="전화번호" id="user_phone" placeholder="'-'을 제외한 숫자만 입력해주세요." autocomplete="off" maxlength="11" /></td>

                        </tr>

                        <tr>

                            <th>문의사항</th>

                            <td><textarea name="상담내용" id="user_comment" placeholder="상담받으실 내용을 입력해주세요." autocomplete="off"></textarea></td>

                        </tr>

                    </table>

                    <div class="agree_text">

                        개인정보 수집 및 이용목적



                        1. 수집하는 개인정보 항목


                        회사는 관심고객등록 등을 통하여 아래와 같은 개인정보를 수집하고 있습니다.


                        - 수집항목 : 이름, 핸드폰 번호


                        - 수집방법 : 홈페이지 관심고객등록



                        2. 개인정보의 수집 및 이용목적 


                        회사는 수집한 개인정보를 다음의 목적을 위해 활용합니다.


                        - 분양정보 및 분양상담 등 문의 처리


                        - 마케팅 및 광고홍보에 활용



                        3. 개인정보의 보유 및 이용기간 


                        회사는 개인정보수집 및 이용목적이 달성된 후에는 예외 없이 해당정보를 지체없이 파기합니다.

                    </div>

                    <label class="agree_btn">

                        개인정보수집에 동의함 <input type="checkbox" name="개인정보보호정책동의" value="동의함" /></p>

<p>                    </label>

                    <div class="btn_confirm">

                        <button>관심고객 등록하기</button>

                    </div>

                </form></p>

<p>

 

send.php

</p>

<p><meta charset="utf-8">

<?php

if(isset($_POST['이메일'])) {

     

    

    $email_to = "이메일 주소가 입력되어있습니다."; 

    $email_subject = "상담 문의드립니다.";

    $email_subject = '=?UTF-8?B?'.base64_encode($email_subject).'?=';</p>

<p>     

     

    function died($error) {

        // your error code can go here

        echo "<script> alert('메일발송을 실패하였습니다.');";

        echo "history.go(-1);";

        echo "</script>";

        die();

    }

     

    $user_name = $_POST['user_name'];

    $email_from = $_POST['이메일'];

    $telephone = $_POST['전화번호'];

    $comments = $_POST['상담내용'];</p>

<p>    $email_message = "";

    

    function clean_string($string) {

      $bad = array("content-type","bcc:","to:","cc:","href");

      return str_replace($bad,"",$string);

    }

     

    $email_message .= "이름 : ".clean_string($user_name)."\n\n";

    $email_message .= "연락처 : ".clean_string($telephone)."\n\n";

    $email_message .= "상담내용 : ".clean_string($comments)."\n\n";

     

     

// create email headers

$headers = 'From: '.$email_from;

// 제목이 깨질경우 아래 캐릭터셋 적용</p>

<p>@mail($email_to, $email_subject, $email_message, $headers);  

?>

 

<!-- include your own success html here -->

 

<script>

alert ("메일이 발송되었습니다.\n빠른 시일안에 답변드리겠습니다.");

history.go(-1);

</script>

 

<?php

}

?></p>

<p>

 

지메일은 수신이 안되는 이유가 뭘까요?

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

답변 1개

채택된 답변
+20 포인트

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

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

로그인