메일은 잘 도착하는데
왜 메일이 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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 284438 | |
| 284437 | |
| 284435 | |
| 284430 | |
| 284420 | |
| 284417 | |
| 284409 | |
| 284401 | |
| 284399 | |
| 284397 | |
| 284380 | |
| 284378 | |
| 284371 | |
| 284370 | |
| 284366 | |
| 284364 | |
| 284360 | |
| 284357 | |
| 284355 | |
| 284354 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기