File name: addrbook/mail.wel (2,324 bytes) Text file viewer v1.2
    1 : #!/bin/wel
    2 : 
    3 : /* file: mail.wel
    4 : 
    5 :    email 발송용 프로그램 (author: 서광현)
    6 : 
    7 :    Copyright (c) 2001/02/22 by Wesoft
    8 :    All Rights Reserved.
    9 : */
   10 : 
   11 : htmlquery("get");
   12 : htmlquery("post");
   13 : include("common.inc");
   14 : 
   15 : message_title= "전자우편 메시지";
   16 : ARG= strform("list={$list}&k={$k}&n={$n}&o={$o}",
   17 :              "&pi={$pi}&pw={$pw}&pm={$pm}&ps={$ps}&pd={$pd}");
   18 : 
   19 : if(lc=="abook") back_url= "addrbook.wel?" ~ ARG;
   20 :  else if(lc=="view") back_url= "view.wel?no=" ~ no ~ "&" ~ ARG;
   21 :  else if(lc=="admview") back_url= "admview.wel?no=" ~ no ~ "&" ~ ARG;
   22 :  else if(lc=="admin") back_url= "admin.wel?" ~ ARG;
   23 :  else back_url= "login.wel";
   24 : 
   25 : if(to!="")
   26 :   {
   27 :     to_name= toname ~ " (" ~ to ~ ")";
   28 :     to_email= to;
   29 :     guide= "내용";
   30 :   }
   31 :  else
   32 :   {
   33 :     to_name= "주소록 관리자";
   34 :     to_email= admin_email;
   35 :     guide= "불편사항이나 문의사항등";
   36 :   }
   37 : 
   38 : if(mailwrite!=1)
   39 :  {
   40 :     idname= id;
   41 :     if(name!="")
   42 :      {
   43 :        if(id=="") idname= name; else idname~= " (" ~ name ~ ")";
   44 :      }
   45 :     if(idname!="")
   46 :      {
   47 :         if(email!="") focus= "Subject"; else focus= "FromEmail";
   48 :         if(id!="") ro_idname= " readonly";
   49 :      }
   50 :     else
   51 :      {
   52 :         focus= "FromName";
   53 :         ro_idname= "";
   54 :      }
   55 :     fm= formdump("form/mail.fom");
   56 :     if(fm==FORM_OPENERR) err_form("mail.fom");
   57 :     return;
   58 :  }
   59 : 
   60 : fp= popen("/usr/lib/sendmail -t", "w");
   61 : if(fp==FILE_OPEN_ERR)
   62 :  {
   63 :     MSG1= "전자우편 시스템 오류";
   64 :     MSG2= "전자우편의 내부 오류가 발생하여 메일을 발송할 수 없습니다."
   65 :         ~ BACK_BUTTON;
   66 :     formdump(message_form);
   67 :     return;
   68 :  }
   69 : 
   70 : VAR_MAILER= PROGRAM_NAME ~ " " ~ PROGRAM_VERSION;
   71 : fprint(fp,"From: ",FromName);
   72 : if(FromEmail!="") fprint(fp," <",FromEmail,">");
   73 : fprint(fp,"\n");
   74 : fprint(fp,"Reply-To: ",FromEmail,"\n");
   75 : fprint(fp,"X-Mailer: ",VAR_MAILER,"\n");
   76 : fprint(fp,"To: ",ToEmail,"\n");
   77 : fprint(fp,"Subject: ",Subject,"\n\n");
   78 : if(to=="")
   79 :  {
   80 :     fprint(fp,"[개인 주소록 프로그램에서 관리자님에게 발송했습니다]\n");
   81 :     fprint(fp," 작성자: ",FromName,"\n");
   82 :     fprint(fp," 작성일: ",date(1)," ",time(1),"\n");
   83 :     fprint(fp," 위  치: ", getcwd(), "\n");
   84 :     fprint(fp,"------------------------------\n");
   85 :  }
   86 : fprint(fp,Text,"\n");
   87 : pclose(fp);
   88 : action= "location.replace('" ~ back_url ~ "')";
   89 : MSG0= "";
   90 : MSG1= "전자우편 발송 종료";
   91 : MSG2= to_name ~ "에게 전자우편을 발송했습니다!<br><br>"
   92 :     ~ button(0,action," 확 인 ","");
   93 : 
   94 : formdump(message_form);
   95 : return;
File name: addrbook/mail.wel (2,324 bytes) Wesoft Corp. ⓒ 2001 All rights reserved.