TAA Tools
SNDSPLMAIL      SEND SPOOLED FILE E-MAIL               TAAEMLD

The Send  Spooled  File E-Mail  command sends  a spooled  file in  *SCS
format  with a  brief text  message  to one  or more  recipients.   The
recipients  are described  by using a  name and  a corresponding E-Mail
address that must exist  in a MAILADRP file  or by entering a  specific
E-Mail  address.   The  SNDDST command  is  used internally.   See  the
SNDTXTMAIL  command for sending  a long text message  without a spooled
file.

See the  MAILADR  tool  for how  to  set  up  and enter  names  into  a
MAILADRP file.

Assume the  name JONES  exists in  the MAILADRP  file which  is on  the
library  list and an  E-Mail address is  assigned to the  JONES record.
A spooled file named  ABC exists in  the users job  and should be  sent
as an attachment.  A typical SNDSPLMAIL command would be:

             SNDSPLMAIL   SUBJECT('The such and such report')
                            SPLF(ABC)
                            SENDTO(JONES)
                            TEXT('See attached spooled file.')

The MAILADRLIB  parameter defaults to  *LIBL meaning the  MAILADRP file
must exist on  the library list.  The user  JONES would be searched for
in  the  file and  the corresponding  E-Mail address  used to  send the
text message.

The SUBJECT value may  be up to 44  characters in length.   The spooled
file name  would be  'ABC.TXT'.  Because  the support only  allows only
for  the 8.3  format, spooled file  names longer  than 8  bytes will be
truncated.

If the  spooled  file  does not  exist  in  the current  job,  the  JOB
parameter must be specified.

The TEXT  parameter value can  be up to 256  bytes and would  appear as
the text of the note.

To use  more of the defaults  of the command, a  more typical use would
be to use the *SELECT options (interactive only):

             SNDSPLMAIL   SUBJECT('The such and such report')
                            TEXT('See attached spooled file.')

The SPLF parameter defaults  to *SELECT which  means the spooled  files
owned by  the current user  are displayed and  a selection may  be made
of  a single spooled  file.   If the  SENDTO parameter is  not *SELECT,
the  command  prompt  is  refreshed and  additional  parameters  may be
entered.

The SENDTO  parameter  defaults  to *SELECT  which  means the  list  of
users  defined to  the MAILADR  tool appears  in a  subfile and  one or
more  may be selected by using  Option 1 and then  pressing Enter.  The
screen  is  refreshed  to  allow  additional  selections.    When   the
selections  are  complete,   F3  may  be  pressed  to   return  to  the
SNDSPLMAIL  command  prompt  with  the  names  of  the  selected  users
filling the SENDTO prompt.

A 'group function'  also exists to  allow the sending to  a group  name
(a list of users).  See the MAILADR tool documentation.

A logging  function  also exists  to log  the E-Mails  that were  sent.
See the 'Mail Logging' section of the MAILADR tool documentation.

To  send  a  spooled   file  by  directly  using  one  or  more  E-Mail
addresses,   SENDTO(*INT)  must  be  specified.     This  provides  the
additional parameter  INTADR when  prompting.  The  command would  look
like:

          SNDSPLMAIL  SUBJECT(xxx) SPLF(xxx) TEXT('...')
                        SENDTO(*INT) INTADR(www@xxx.zzz)

Troubleshooting
---------------

If the  SNDSPLMAIL command fails, there should  be appropriate messages
from the tool describing the error.

A  typical error  is when  the Email  has the  correct syntax,  but the
domain does  not  exist.   You  can  check  all the  addresses  in  the
MAILADRP file with:

             CHKMAILFLD FILE(MAILADRP) FIELD(MAINTA)

If the  SNDSPLMAIL command  completes normally,  but no E-Mail  message
arrives  at the destination,  try SNDDST by  itself (SNDSPLMAIL command
generates SNDDST).  Try the following command:

             SNDDST     TYPE(*LMSG)
                          TOINTNET('xxxx')
                          DSTD('A test message')
                          LONGMSG('This is a test')

where xxxx is a valid E-Mail address.

If no E-Mail message is sent, the problem exists with the system.

The system  mail server  jobs must  be  active.   Try ending  the  mail
server jobs with ENDMSF  and then restarting with STRMSF.   Even though
the STRMSF  command may complete  normally, there could  be messages in
QSYSOPR relating to problems with the MSF job.

How SNDSPLMAIL works
--------------------

The   user  names   are  accessed   from  the   MAILADRP  file.     The
corresponding E-Mail address are used when the note is sent.

The TAAFLR  folder  is ensured  to  exist in  QDOC.   The  TAA  command
CPYSPLFIFS  is used  to convert  the spooled  file to  a document  in a
sub-folder  in TAAFLR.   The sub-folder  name is the  spooled file name
(up to 8 characters  plus '.TXT').  CHGDOCD is  then used to place  the
subject  into  the document  description.    This becomes  the  Email's
subject name instead of the file name.

The  document is  sent via  the SNDDST command  specifying the  DOC and
FLR parameters.   After the Email  is sent, both the  document and  the
sub-folder are deleted.

SNDSPLMAIL escape messages you can monitor for
----------------------------------------------

      TAA9891    The user name does not exist.
      TAA9883    The spooled file was not found.
      TAA9884    The job with the spooled file does not exist.
      TAA9885    The spooled file is still open and cannot be sent.

Escape messages from based on functions will be re-sent.

SNDSPLMAIL Command parameters                         *CMD
-----------------------------

   SUBJECT       The  subject matter  may  be up  to  44 characters  in
                 length.  At least one character must be entered.

   SPLF          The  spooled file  name  to be  sent.   Only  a single
                 spooled   file   may  be   sent   with  each   use  of
                 SNDSPLMAIL.

                 The default is  *SELECT which may  only be used in  an
                 interactive  job   and  displays  a   subfile  of  the
                 spooled  files owned  by the  current user.   A single
                 spooled file may be selected.

                 A specific  spooled file  name may  be  entered.   Use
                 the JOB  parameter if the spooled  file is not  in the
                 current  job.   If the  spooled  file does  not exist,
                 TAA9883 is sent as an escape message.

                 The spooled  file name  entered is  concatenated  with
                 '.TXT' to  be the name  of the  attached file for  the
                 receiving user.   Because the support  allows only the
                 8.3  format for the attachment  name, any names longer
                 than 8 characters will  be truncated.  Thus a  spooled
                 file  name of  ABCDEFGHIJ would  create an  attachment
                 name of ABCDEFGH.TXT.

   SENDTO        The SENDTO parameter allows:

                     - Sending to a name in the MAILADRP file
                     - Selection from the MAILADRP file
                     - Sending to an E-Mail using the INTADR parm

                 *SELECT  is the  default which invokes  the SELMAILADR
                 command.    This  provides  a  subfile  of  all  names
                 entered   into   the   MAILADRP   file   (entered   by
                 WRKMAILADR).   After  selecting the  names to  be sent
                 to using  the  '1'  Option  and  pressing  Enter,  the
                 screen  is  refreshed  to  allow   more  users  to  be
                 entered.

                 An  'X' is  displayed  in  the option  column  for any
                 selected   entries.     You  may   cancel  a  previous
                 selection by entering a blank.

                 When all  names you  want  have been  selected, F3  is
                 used to  return to the  SNDSPLMAIL prompt.   The names
                 of  the selected  users  are filled  in to  the SENDTO
                 parameter.

                 A group name may also  be entered (see the  discussion
                 of 'Group  names' in the MAILADR  tool documentation).

                 When *SELECT  is used, the recipient  type defaults to
                 *TO for  primary  recipient for  all  selected  names.
                 This  value  may   be  changed  at  the  top   of  the
                 selection  display  to  *CC  (carbon  copy),  or  *BCC
                 (blind  carbon  copy).   Each  time the  Enter  key is
                 pressed, the  value for  recipient type  will be  used
                 for those selected users.

                 Instead  of the default  of *SELECT,  you may  enter a
                 user   name  into  the   first  part   of  the  SENDTO
                 parameter.  The name must  exist in the MAILADRP  file
                 (note  that the  E-Mail  address is  not entered  into
                 the SENDTO parameter).

                 The  second part  describes the  recipient type.   *TO
                 is  the  default  meaning  the  user  is  the  primary
                 recipient.

                 *CC may  be entered meaning  the recipient  receives a
                 copy, but is not the primary recipient.

                 *BCC may  be entered meaning the  recipient receives a
                 blind  copy and is not  identified in the distribution
                 list.

                 Up to 50 names may be entered.

                 An E-Mail  address  may be  entered  on SNDTXTMAIL  by
                 using  SENDTO(*INT)  and   then  entering  the  E-Mail
                 address in the INTADR parameter.

   JOB           The   qualified  job  name  where   the  spooled  file
                 exists.  An  * is  the default and  means the  current
                 job.   If the job does  not exist, TAA9884 is  sent as
                 an escape message.

   SPLNBR        The  spooled  file  number.    *ONLY  is the  default.
                 *LAST may  be specified  or  a specific  spooled  file
                 number in the range of 000001 - 999999.

   TEXT          The  text of  the  message  which  may be  up  to  256
                 bytes.   No special characters may be  entered to help
                 format the text.

   INTADR        If  SENDTO(*INT)  is  entered,  a  list  of  up  to 50
                 internet addresses may be entered.

                 A two part parameter is required.

                 The  first part  is  the  E-Mail  address  (up  to  90
                 bytes).

                 The  second part  describes the  recipient type.   *TO
                 is  the  default  meaning  the  user  is  the  primary
                 recipient.

                 *CC may be  entered meaning  the recipient receives  a
                 copy, but is not the primary recipient.

                 *BCC may be  entered meaning the recipient  receives a
                 blind  copy and is not  identified in the distribution
                 list.

   MAILADRLIB    The name of the library  where the Mail Address  files
                 exist.  *LIBL is  the default.  A specific  library or
                 *CURLIB may also be entered.

   TEST          A  *YES/*NO option for  whether testing  is occurring.

                 *NO is the default meaning an E-Mail will be sent.

                 *YES  may  be specified  to  cause the  SNDDST command
                 that will be used  to be logged as a message,  but not
                 run.   The MAILLOGP  file will  be updated  if logging
                 is set on.


Restrictions
------------

Only spooled files in *SCS format are supported.

The spooled file cannot be open (it must be closed).

The Mail Servers must be active (see the STRMSF command).

Spooled file  names longer than 8 bytes will  be truncated to 8 as seen
by the receiving user.

Prerequisites
-------------

The following TAA Tools must be on your system:

     CHKIFSE         Check IFS entry
     CHKSPLF         Check spooled file
     CPYSPLFIFS      Copy spooled file to the IFS
     EDTVAR          Edit variable
     EXTLST          Extract list
     RSNALLMSG       Resend all messages
     RSNLSTMSG       Resend last message
     RTVMAILADR      Retrieve mail address
     RTVSPLFA        Retrieve spooled file attributes
     SELSPLF         Select spooled file
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDLNGMSG       Send long message

Implementation
--------------

You must have a MAILADR file  created with the user names that will  be
used by SNDSPLMAIL.

The mail servers must be active (see the STRMSF command).

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   SNDSPLMAIL    *CMD                   TAAEMLD       QATTCMD
   TAAEMLDC      *PGM       CLP         TAAEMLDC      QATTCL
					

Added to TAA Productivity tools May 15, 2008


Home Page Up to Top