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

</strong></p>

<p><strong><meta charset="UTF-8"></strong></p>

<p><strong><?php</strong></p>

<p><strong>if(isset($_POST['email'])) {

     

    

    $email_to = "메일주소@도메인.kr, 메일주소@gmail.com";

    $email_subject = "A/S 문의입니다.";

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

<p><strong>     

    function died($error) {

        // your error code can go here

        echo "<script> alert('이메일 전송에 실패했습니다.');";

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

        echo "</script>";

        die();

    }

    

        function diedcatcha($error) {

        // your error code can go here

        echo "<script> alert('자동등록방지를 다시 기입해주세요.');";

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

        echo "</script>";

        die();

    }

     

    // validation expected data exists

    if(!isset($_POST['first_name']) ||

           !isset($_POST['country']) ||

           !isset($_POST['company']) ||

        !isset($_POST['telephone']) ||

        !isset($_POST['email']) ||

           !isset($_POST['captcha']) ||

        !isset($_POST['comments'])) {

        died('메일발송을 실패했습니다.');       

    }

    

    //자동입력방지 문구 실패 메세지

    session_start();

    if($_SESSION['capt'] != $_POST['captcha'])

        {diedcatcha($error_message);

    }</strong></p>

<p><strong>    $first_name = $_POST['first_name']; // required

    $last_name = $_POST['last_name']; // required

    $country = $_POST['country'];

    $company = $_POST['company'];

    $telephone = $_POST['telephone']; // not required

    $email1 = $_REQUEST['email'];

    $email2 = $_REQUEST['email2'];

    $email_from = $email1."@".$email2; // required

    $product = $_REQUEST['product'];

    $comments = $_POST['comments']; // required

     

    $error_message = "";

    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}$/';</strong></p>

<p><strong>   </strong></p>

<p><strong>    //문의내용이 한글자 이상 작성되지 않으면 메일발송 실패

  //if(strlen($comments) < 2) {

    //$error_message .= 'The Comments you entered do not appear to be valid.
';

  //}

    

  if(strlen($error_message) > 0) {

    died($error_message);

  }

      $email_message = '=?UTF-8?B?'.base64_encode($email_subject).'?=';

    $email_message = "";

     

    function clean_string($string) {

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

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

    }

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

    $email_message .= "성 : ".clean_string($last_name)."\n\n";

    $email_message .= "국가 또는 지역 : ".clean_string($country)."\n\n";

    $email_message .= "회사: ".clean_string($company)."\n\n";

    $email_message .= "번호 : ".clean_string($telephone)."\n\n";

    $email_message .= "이메일 : ".clean_string($email_from)."\n\n";

    $email_message .= "제품 : ".clean_string($product)."\n\n";

    $email_message .= "비고 : ".clean_string($comments)."\n\n";

     

     

// create email headers

$headers = 'From: '.$email_from;

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

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

    

    

?></strong></p>

<p><strong> 

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

<!--location.href='../';-->

 

<script>

alert ("메일이 성공적으로 발송되었습니다.");

location.href='./as.php'; 

</script>

 

<?php

}

?></strong></p>

<p><strong>
 

 

 

그누보드안에 formail.php와 send.php를 만들어서 제품문의 페이지를 만들었습니다.

다른 메일주소는 잘 가는데 gamail과 .kr로 끝나는 메일주소로는 메일이 전송되지 않습니다ㅠㅠ

어떤 소소를 추가해야될까요..?

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

답변 2개

인코딩 문제일수도 있을거 같네요

 

$email_message = '=?UTF-8?B?' . base64_encode($email_subject) . "?=\n\n"; $email_message .= "이름 : " . clean_string($first_name) . "\n\n"; $email_message .= "성 : " . clean_string($last_name) . "\n\n"; $email_message .= "국가 또는 지역 : " . clean_string($country) . "\n\n"; $email_message .= "회사: " . clean_string($company) . "\n\n"; $email_message .= "번호 : " . clean_string($telephone) . "\n\n"; $email_message .= "이메일 : " . clean_string($email_from) . "\n\n"; $email_message .= "제품 : " . clean_string($product) . "\n\n"; $email_message .= "비고 : " . clean_string($comments) . "\n\n"; $email_message = '=?UTF-8?B?' . base64_encode($email_message) . '?=';  

이메일 제목과 본문 UTF-8로 인코딩 해보세요

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

안되네요ㅠㅠ

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

스팸으로 걸러지는건 아니신지요?

white domain 등록을 해보셨는지요?

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

스팸은 아닙니다ㅠㅠ WHITE domain은 안해봤네요ㅠㅠ
한번 화이트 도메인(kisa)에 등록해보심을 추천드리며...
호스팅 일경우 MX 관리(메일서버) 쪽도 봐야 하지만 현재 다른 메일은 가고...
gmail 과 .kr 쪽이 안가신다 하셨으니...
정말 제 개인 소견으로는 화이트 도메인을 해보심을 조심스레 추천드립니다.

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

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

로그인

전체 질문 목록

🐛 버그신고