home *** CD-ROM | disk | FTP | other *** search
/ Cuteskunk BBS / cuteskunk.zip / cuteskunk / Cellular2 / 1c.txt < prev    next >
Text File  |  2003-06-29  |  1KB  |  63 lines

  1. #! /bin/csh -fB
  2. ### This is a simple shell script for easy use of anonymous mail.  To run the
  3. ### program just save it and delete everything up until the #! /bin/csh -fB
  4. ### line.  Then just type the name you save it as or the name and whoever
  5. ### you will be mailing.  e.g.  amail bill@some.university.edu or just amail.
  6. ###
  7.  
  8. if ($1 != "") then
  9.    set mto=$1
  10. else
  11.    echo 'To: '
  12.    set mto=$<
  13. endif
  14.  
  15. echo -n 'From: '
  16. set mfrom=$<
  17.  
  18. echo -n 'Use which host for smtp (return for '`hostname`') ? '
  19. set usehost=$<
  20.  
  21. echo -n 'Use which editor (return for vi)? '
  22. set editor=$<
  23. if($editor =="") then
  24.    set editor=vi
  25. endif
  26.  
  27. if ($mfrom == "") then
  28.    set mfrom=`whoami`'@'`hostname`
  29. endif
  30.  
  31. echo 'helo amail' >> tmpamail1
  32. echo 'mail from: '$mfrom >> tmpamail1
  33. echo 'rcpt to: '$mto >> tmpamail1
  34. echo 'data' >> tmpamail1
  35.  
  36. $editor tmpamail2
  37. clear
  38. echo -n 'Are you sure you want to send this? '
  39. set yorn=$<
  40. if($yorn == 'y') then
  41.    echo . >> tmpamail2
  42.    echo quit >> tmpamail2
  43.    cat tmpamail2 >> tmpamail1
  44.    telnet $usehost  25 < tmpamail1 > /dev/null
  45.    echo 'Mail has been sent to: '$mto
  46.    echo '                 From: '$mfrom
  47. endif
  48. rm tmpamail1 tmpamail2
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.