home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmsmp.zip / MAILME.E < prev    next >
Text File  |  1996-05-07  |  1KB  |  47 lines

  1. /*
  2. Here's an EPM macro that invokes Sendmail to send the current file to the
  3. addressee(s) given as an argument (or prompted for, if no argument is
  4. provided - e.g., when used in the EPM 6 toolbar).
  5.  
  6. Set the my_EMAIL_ADDRESS constant appropriately, here or in your MYCNF.E.
  7.  
  8. Larry Margolis - MARGOLI at YKTVMV
  9. */
  10.  
  11. compile if not defined(SMALL)  -- If SMALL not defined, then being separately compiled.
  12.  define INCLUDING_FILE = 'MAILME.E'
  13. const
  14.    tryinclude 'MYCNF.E'        -- Get the user's configuration customizations.
  15.  
  16.    include "english.e"
  17.  
  18. defmain
  19.    'mailme' arg(1)
  20. compile endif
  21.  
  22. compile if not defined(my_EMAIL_ADDRESS)
  23.    const
  24.       my_EMAIL_ADDRESS = 'myuserid@local.com'
  25. compile endif
  26.  
  27. defc MailMe =
  28.    universal vTEMP_FILENAME
  29.    mail_to = arg(1)
  30.    if mail_to = '' then
  31.        mail_to = entrybox("Enter list of addressees")
  32.       if mail_to = '' then
  33.          return
  34.       endif
  35.    endif
  36.    if .modify then
  37.       'xcom save /q' vTEMP_FILENAME
  38.       if rc then
  39.          sayerror ERROR_SAVING_HALT__MSG
  40.          return
  41.       endif
  42.       'sendmail -af' vTEMP_FILENAME '-f' my_EMAIL_ADDRESS mail_to
  43.       call erasetemp(vTEMP_FILENAME)
  44.    else
  45.       'sendmail -af' .filename '-f' my_EMAIL_ADDRESS mail_to
  46.    endif
  47.