왜 메일이 2번이나 오죠? 가르쳐주세요~~~~~~
메일은 잘 도착하는데
왜 메일이 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('편지전송에 실패하였습니다.');} // 편지가 전달되지 않으면 나오는 함수
?>
왜 메일이 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개
13년 전
실제 메일발송 함수는 mail( 에서 발송하는데 이걸 두번호출하는부분은 따로 안보입니다 아마
submit 이 두번이러난다거나 메일발송 하는 로직이 두번 호출되는게 아닌가 합니다.
submit 이 두번이러난다거나 메일발송 하는 로직이 두번 호출되는게 아닌가 합니다.
게시판 목록
그누4 질문답변
그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.
기존 게시물은 열람만 가능합니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 66374 | 11년 전 | 2482 | ||
| 66373 |
narasarang
|
11년 전 | 4466 | |
| 66372 |
오래된미래
|
11년 전 | 2035 | |
| 66371 |
hchan77
|
11년 전 | 2667 | |
| 66370 | 11년 전 | 2073 | ||
| 66369 |
Mariplay
|
11년 전 | 4719 | |
| 66368 | 11년 전 | 2124 | ||
| 66367 |
겟타123
|
11년 전 | 2414 | |
| 66366 |
|
11년 전 | 2943 | |
| 66365 | 11년 전 | 2538 | ||
| 66364 |
jjuguning
|
11년 전 | 2062 | |
| 66363 | 11년 전 | 2615 | ||
| 66362 |
찰리콘트롤
|
11년 전 | 2222 | |
| 66361 | 11년 전 | 2983 | ||
| 66360 | 11년 전 | 3288 | ||
| 66359 |
테크노관리자
|
11년 전 | 3162 | |
| 66358 | 11년 전 | 2549 | ||
| 66357 | 11년 전 | 2927 | ||
| 66356 |
Mariplay
|
11년 전 | 2319 | |
| 66355 |
nsakura
|
11년 전 | 2739 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기