File name: welboard2/mail.wel (2,165 bytes) Text file viewer v1.2
    1 : #!/bin/wel
    2 : 
    3 : /* file: mail.wel
    4 : 
    5 :    email 발송용 프로그램 (author: 서광현)
    6 : 
    7 :    Copyright (c) 2001/03/25 by Wesoft
    8 :    All Rights Reserved.
    9 : */
   10 : 
   11 : htmlquery("get");
   12 : htmlquery("post");
   13 : break_on= 0;
   14 : if(include("include/board.inc")!=OK) return;
   15 : 
   16 : message_title= "전자우편 메시지";
   17 : ARG= strform("db={$db}&pg={$pg}&bp={$bp}&sk={$sk}&no={$no}&vn={$vn}&k={$k}&cn={$cn}&cs={$cs}&cc={$cc}&nt={$nt}");
   18 : 
   19 : if(to!="")
   20 :   {
   21 :     to_name= toname ~ " (" ~ to ~ ")";
   22 :     to_email= to;
   23 :     guide= "내용";
   24 :   }
   25 :  else
   26 :   {
   27 :     to_name= board_name ~ " 관리자";
   28 :     to_email= board_admin_email;
   29 :     guide= "불편사항이나 문의사항등";
   30 :   }
   31 : 
   32 : if(mailwrite!=1)
   33 :  {
   34 :     if(ckname=="") focus= "FromName";
   35 :      else if(ckemail!="") focus= "Subject";
   36 :      else focus= "FromEmail";
   37 :     fm= formdump(skin~"mail.fom");
   38 :     if(fm==FORM_OPENERR) err_form("mail.fom");
   39 :     return;
   40 :  }
   41 : 
   42 : fp= popen("/usr/lib/sendmail -t", "w");
   43 : if(fp==FILE_OPEN_ERR)
   44 :  {
   45 :     MSG1= "전자우편 시스템 오류";
   46 :     MSG2= "전자우편의 내부 오류가 발생하여 메일을 발송할 수 없습니다."
   47 :         ~ BACK_BUTTON;
   48 :     formdump(message_form);
   49 :     return;
   50 :  }
   51 : 
   52 : VAR_MAILER= PROGRAM_NAME ~ " " ~ PROGRAM_VERSION;
   53 : fprint(fp, "Return-Path: ",board_admin_email, "\n");
   54 : fprint(fp,"From: ",FromName);
   55 : if(FromEmail!="") fprint(fp," <",FromEmail,">");
   56 : fprint(fp,"\n");
   57 : fprint(fp,"Reply-To: ",FromEmail,"\n");
   58 : fprint(fp,"X-Mailer: ",VAR_MAILER,"\n");
   59 : fprint(fp,"To: ",ToEmail,"\n");
   60 : fprint(fp,"Subject: ",Subject,"\n\n");
   61 : if(ToEmail==board_admin_email)
   62 :  {
   63 :     fprint(fp,"[", board_name, "] ", prg_title,
   64 :               "에서 관리자님에게 발송했습니다.\n");
   65 :     fprint(fp," Email 작성자: ",FromName,"\n");
   66 :     fprint(fp," Email 작성일: ",date(1)," ",time(1),"\n");
   67 :     board_url= "http://" ~ getenv("SERVER_NAME")
   68 :              ~ strchange(getenv("SCRIPT_NAME"), "write.wel", "board.wel")
   69 :              ~ "?db=" ~ db;
   70 :     fprint(fp," ", prg_title, "   URL: ", board_url, "\n");
   71 :     fprint(fp," ", prg_title, "  경로: ", getcwd(), "\n");
   72 :     fprint(fp," ", prg_title, "  이름: ", board_name,
   73 :               " , 데이터베이스 이름: ",db,"\n");
   74 :     fprint(fp,"------------------------------\n");
   75 :  }
   76 : fprint(fp,Text,"\n");
   77 : pclose(fp);
   78 : replace_location(lc~".wel?"~ARG);
   79 : return;
File name: welboard2/mail.wel (2,165 bytes) Wesoft Corp. ⓒ 2001 All rights reserved.