>> Read No. 30021 article  
[급질문]php3 소스를 이용한 폼메일에서 ...

등록 2001-05-11 16:31:00     조회 1
이름 김성민    

안녕하세요
 리눅스 초보자로 발을 들여놓은 놈입니다.
 제가 폼메일을 이용해서 다른사람들에게 메일을 보내고자
php3소스를 다운받아서 사용을 할려구 하는데요
제 메일계정으로 보내면 잘오는데여 ... 다른 웹메일서비스하는곳이나
다른 이메일주소를 가진 사람들에게 보내면 메일이 가지 않고
root 계정으로 되돌아 옵니다.
 아웃룩 익스프레스 에서는 어디든 잘보내지고 하는데요
 폼엘일에서 보내면 안가요 ... 정말 환장하겠더군요
 sendmail은 8.11.2이구요
스팸메일 방지와 기타다른이유로 libsasl-1.5.24와 openssl-0.9.5a를
같이 설치 했습니다
 아웃룩 익스프레스에서 제대로 작동된다면 sendmail설정에는 이상이 없는것 같은
데
폼메일소스를 의심쪽으로 생각하다가도 다른곳에 있는테스트 잘되는 소스를
다운받은상태라 이것두 아닌것 같구 정말 미치겠군요
 리눅서 고수님들 저좀 도와주세요
 참고로 제가 테스트 하고 있는 폼메일 소스를 아래에 적어넣겠습니다.. 혹
소스가 잘못되었을지도 모르니 ...
 그럼 답변 부탁드립니다 ..
 ***********************************************************************
***
<html>
<head>
<title>php3로 구현한 웹메일</title>
<meta http-equiv='Content-Type' content='text/html; charset=euc-kr'>
<STYLE TYPE="text/css">
<!--
	A:link	{text-decoration:none; color:darkblue}
	A:visited{text-decoration:none; color:663399}
	A:hover {text-decoration:none; color:red}
	A:active {text-decoration:none; color:red}
	TD {font-size:9pt}
-->
</STYLE>
</head>
 <body bgcolor='#FFFFFF'>
 <?php
 //==================
// 메일 보내기
//==================
 if($mode=='mailsend')
{
 if(!$to)
    {   echo(" <script>
                  window.alert('메일을 보내실 분의 메일계정을 적으셔야 메
일을 보내실 수가 있습니다.')
                  history.go(-1)
                 </script>
               "); exit;
    }
  if(!$subject)
    {   echo(" <script>
                  window.alert('메일 제목이 없습니다. 메일 제목을 입력해
주십시오.')
                  history.go(-1)
                 </script>
               "); exit;
    }
 //echo(" $userfile  $userfile_size ");
 //       $body = stripslashes($body);
//       $mailheaders .= "To:" . $to . "
";
//       $mailheaders .= "Subject:" . $subject . "
";
       $mailheaders .= "Return-Path:$from
";
       $mailheaders .= "From:$rn <$from>
";
       $mailheaders .= "X-Mailer: Gfew Interface
";
//       $mailheaders .= "Reply-To:$from
";
        if ($userfile && $userfile_size) {
           $filename=basename($userfile_name);
          $result=fopen($userfile,"r");
          $file=fread($result,$userfile_size);
          fclose($result);
           if ($userfile_type == "")
	     {
             $userfile_type = "application/octet-stream";
             }
           $boundary = "--------" . uniqid("part");
           $mailheaders .= "MIME-Version:1.0
";
          $mailheaders .= "Content-Type: multipart/mixed;
boundary="$boundary"";
           $bodytext  = "This is a multi-part message in MIME
format.
 ";
          $bodytext .= "--$boundary
";
           $bodytext .= "Content-Type: text/html; charset=euc-kr
";
          $bodytext .= "Content-Transfer-Encoding: 8bit
 ";
 //          $bodytext .= "Content-Type: text/plain; charset=euc-
kr
";
//          $bodytext .= "Content-Transfer-Encoding: 8bit
 ";
//          $bodytext .= "Content-Type: text/plain; charset=us-
ascii
";
//          $bodytext .= "Content-Transfer-Encoding: 7bit
 ";
          $bodytext .= nl2br(stripslashes($body)) . "
 ";
          $bodytext .= "--$boundary
";
          $bodytext .= "Content-Type:$userfile_type;
name="$filename"
";
          $bodytext .= "Content-Transfer-Encoding: base64
 ";
          $bodytext .= ereg_replace("(.{80})","1
",base64_encode
($file));
          $bodytext .= "
--$boundary" . "
";
       }
       else {
          $bodytext  = stripslashes($body);
       }
         mail($to,$subject,$bodytext,$mailheaders);
        echo(" <meta http-equiv='Refresh' content='0;
URL=./mailsuccess.php3'>");
       exit;
 //echo("$Ext , $bodytext");
//       #778899 #e0e0e0
 }
 echo("
  <table width=570 border=0 cellspacing=1 align='center'
cellpadding='1' bgcolor='#6B7BAD'>
    <tr>
      <td align=center bgcolor='ghostwhite' nowrap>
      Gfew Interface 에서 제공하는 웹메일입니다. 동호회 주소록에 등록한 모
든 분들께<br>
      메일을 보내시려면 <font color='red'>받는사람란에 gfews at gfew.co.kr 이라고 쓰시면<br>
      주소록에 등록된 모든 분들께 한꺼번에 메일을 전송</font>하실 수가 있
습니다.<p>
      개인적으로 보내셔도 무방합니다. 받는사람란에 보내고자하는 분의 메일계
정을 적으시면 됩니다.
      </td>
    </tr>
  </table><p>
 <form enctype='multipart/form-data' method='post' action='$PHP_SELF?
mode=mailsend'>
  <table border=0 cellspacing=1 align='center' cellpadding='1'
bgcolor='#6B7BAD'>
    <tr>
      <td align=center bgcolor='#6B7BAD' nowrap> <font color='white'>
        받는 사람 </font> </td>
      <td bgcolor='ghostwhite'> <font color='#000000' size=-1>
        <input name=to size=68 value=''>
        </font> </td>
    </tr>
    <tr>
      <td align=center bgcolor='#6B7BAD' nowrap> <font
color='#ffffff'>
        보내는 사람 </font> </td>
      <td bgcolor='ghostwhite'> <font color='#000000' size=-1>
        <input name=from size=68 value=''>
        </font> </td>
    </tr>
    <tr>
      <td align=center bgcolor='#6B7BAD' nowrap> <font
color='#ffffff'>
        제 목 </font> </td>
      <td bgcolor='ghostwhite'> <font color='#000000' size=-1>
        <input name=subject size=68 value=''>
        </font> </td>
    </tr>
    <tr>
      <td align=center bgcolor='#6B7BAD' nowrap> <font
color='#ffffff'>
        전송할 파일 </font> </td>
      <td bgcolor='ghostwhite'> <font color='#000000' size=-1>
        <input type=file name=userfile size=53 value=''>
        </font> </td>
    </tr>
    <tr>
      <td colspan=2 bgcolor='ghostwhite'>
        <textarea name=body cols=78 rows=10 wrap=hard></textarea>
      </td>
    </tr>
    <tr>
      <td colspan=2 bgcolor='ghostwhite'>
        <div align='center'><font size=-1>
          <input type=submit name=action value='메일전송하기'>
          <input type='reset' name='Reset' value='취소하기'>
          &nbsp;</font> </div>
      </td>
    </tr>
  </table>
  </form>
   <table width=570 border=0 cellspacing=1 align='center'
cellpadding='1'>
    <tr>
      <td align=center nowrap>
      <hr size=1 color=#6B7BAD>
      <font color='#6B7BAD'>모두 함께하는 동아리 Cell</font>
      </td>
    </tr>
  </table>
");
?>
</body>
</html>
이름
암호
Register [ localhost 목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.44 초 ] 작업시간: [ 0.03 초 ]

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved
[TOP]

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1789547556
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.