폼메일이 발송이 안되네요.. 왜 그럴까요?

폼메일이 발송이 안되네요.. 왜 그럴까요?

QA

폼메일이 발송이 안되네요.. 왜 그럴까요?

본문

기존 사용하던 폼메일에서

몇가지 지우고 연락처 하나만 받으려고

하는데 메일이 오지가 않네요..

도움부탁드립니다.

 


<meta charset="utf-8">
<?php
if(isset($_POST['telephone'])) {
     
    
	$email_to = "---.com";
	$email_subject = "[폼메일] 견적의뢰 문의사항입니다.";
	$email_subject = '=?UTF-8?B?'.base64_encode($email_subject).'?=';
 
     
     
    function died($error) {
        // your error code can go here
        echo "<script> alert('메일발송을 실패하였습니다.\\n이메일 및 연락처를 정확히 입력해주세요.');";
		echo "history.go(-1);";
		echo "</script>";
        die();
    }
     
    // validation expected data exists
    if( !isset($_POST['telephone'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');       
    }
     
    $telephone = $_POST['telephone']; // not required
     
    $error_message = "";
    
  if(strlen($telephone) < 2) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  }
  if(strlen($error_message) > 0) {
    died($error_message);
  }
    $email_message = "";
     
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }
     
    $email_message .= "연락처 : ".clean_string($telephone)."\n\n";
     
     
// create email headers
$headers = 'From: '.$email_from;
// 제목이 깨질경우 아래 캐릭터셋 적용
 
@mail($email_to, $email_subject, $email_message, $headers);  
?>
 
<!-- include your own success html here -->
 
<script>
alert ("메일이 발송되었습니다.\n빠른 시일안에 답변드리겠습니다.");
location.href="http://---.com/";
</script>
 
<?php
}
?>

이 질문에 댓글 쓰기 :

답변 2


@mail($email_to, $email_subject, $email_message, $headers);  


위 코드 상단에

echo $email_to;

echo $email_subject;

echo $email_message;

echo $headers;

 

이렇게 ㅉ기어보고 나온 값을 한번 댓글로 서줘세요  

 

 

메일이 안오는데는 여러가지 원인이 있을수있습니다
먼저 mail함수뒤에 들어가는 값을찍어보고
체크해보세여
답변을 작성하시기 전에 로그인 해주세요.
전체 130
QA 내용 검색

회원로그인

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