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

왜 메일이 2번이나 오죠? 가르쳐주세요~~~~~~

· 13년 전 · 962 · 1
메일은 잘 도착하는데

왜 메일이 2번이나 오죠? 가르쳐주세요~~~~~~



<?
//#####################################
//#### 파일명 : Zmail ####
//#### 제작사 : http://zboard.cafe24.com ####
//#### 제작자 : zboard@zboard.cafe24.com ####
//#### 제작일 : 2002/12/19 ####
//#### 버전 : Zmail1.0 ####
//#####################################


// 창에 이름및 주소를 안적으면 나오는 에러 메세지를 나오게 하는 함수입니다..






function error($text){
echo "
<script language=javascript>
window.alert('$text')
history.go(-1)
</script>";
exit;
}

// 메일 보내기가 성공하거나 실패의 여부를 나오게 하는 함수

function msg($text){
echo "
<script language=javascript>
window.alert('$text')
</script>
<meta http-equiv='refresh' content='0;url=zmailing.php'><meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
exit;
}




$charset='UTF-8'; // 문자셋 : UTF-8
$subject='메일링가입'; // 제목
$toName='받는이';
$toEmail=$tomail;
$fromName=$name; // 보내는이 이름

$encoded_subject="=?".$charset."?B?".base64_encode($subject)."?=\n"; // 인코딩된 제목
$to= "\"=?".$charset."?B?".base64_encode($toName)."?=\" <".$tomail.">" ; // 인코딩된 받는이
$from= "\"=?".$charset."?B?".base64_encode($name)."?=\" <".$frommail.">" ; // 인코딩된 보내는이

$headers="MIME-Version: 1.0\n".
"Content-Type: text/html; charset=".$charset."; format=flowed\n".
"To: ". $to ."\n".
"From: ".$from."\n".
"Return-Path: ".$from."\n".
"Content-Transfer-Encoding: 8bit\n"; // 헤더 설정





if (!$name) {error('이름을 적어주세요.');} // 이름이 없을때 에러 메세지
if(!ereg("@",$frommail)) {error('보내는 주소를 적어주세요.');} // 보내는 메일주소나 @이 없으면 나오는 에러메세지
if(!ereg("@",$tomail)) {error('받는 주소를 적어주세요.');} // 받는 메일주소나 @이 없으면 나오는 에러메세지
if (!$body) {error('내용을 적어주세요.');} // 내용을 안적으면 나오는 에러 메세지
//$body+= $select;

$result=mail( $to , $encoded_subject , "
이름: $name <br>
나이: $age <br>
직업: $job <br>
메일주소: $frommail<br>
연락처: $phon<br>
---------------------------------------------------<br>
기타 하고싶은말 내용: <br>
$body" , $headers ); // 메일 보내기


if($result){msg('메일이 성공적으로 보내졌습니다.');} // 성공하면 나오는 메제시
else{error('편지전송에 실패하였습니다.');} // 편지가 전달되지 않으면 나오는 함수

?>

댓글 작성

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

로그인하기

댓글 1개

실제 메일발송 함수는 mail( 에서 발송하는데 이걸 두번호출하는부분은 따로 안보입니다 아마
submit 이 두번이러난다거나 메일발송 하는 로직이 두번 호출되는게 아닌가 합니다.

게시글 목록

번호 제목
284348
284336
284333
284332
284320
284318
284316
284313
284307
284306
284303
284298
284296
284290
284286
284280
284277
284272
284261
284259