TAA Tools
SNDOBJMAIL      SEND OBJECT MAIL                       TAAIFUF

The  Send  Object  Mail  command  simplifies   sending  objects  as  an
attachment to  an Email.  The command uses  the sub tools SAVOBJIFS and
SNDIFSMAIL  to create  a save file  in QTEMP, save  the object(s), copy
the save file to an IFS  stream file, and attach the stream file  to an
E-mail which  is sent using  the SNDDST system  command.  The  TAA Tool
RSTOBJIFS may be used to restore the object(s).

You  must have  the special authority  *SAVSYS or  the object existence
right to the objects being saved.

A typical SNDOBJMAIL command would be:

             SNDOBJMAIL    SUBJECT(sss) OBJ(xxx) LIB(ABC)

Several defaults occur:

  **   The default for  the OBJTYPE  parameter is *ALL  for all  object
       types.

  **   The  default for  the  STMFDIR parameter  is  *HOME meaning  the
       user profile  must have a home directory  and the directory must
       exist.

  **   The default for the  stream file name is  *LIB meaning the  same
       name as the library.

  **   The default for the stream file extension is '.SAVF'.

The  home  directory  would be  retrieved  and  concatenated  with  the
stream  file name  and extension  to produce  an  IFS stream  file name
such as:

             /HOME/usrprf/ABC.SAVF

If  the stream file does not exist, it is  added.  If it does exist, it
is replaced.

The  default  for  SENDTO  is  to  prompt  for  the  names  and  E-mail
addresses  defined to  the  MAILADR TAA  Tool  (see later  discussion).
This allows a selection of one or more recipients.

By  default, the stream file  is removed after the  sending the E-mail.

If a failure occurs, the stream file may be left on the system.

Restoring the object(s)
----------------------

There are several  solutions to  restore the object(s).   The  simplest
is to for the user ot use his home directory and RSTOBJIFS.

Add the attachment to your home directory and do:

             RSTOBJIFS   SAVLIB(ABC)

RSTOBJIFS converts  the stream file  to a save  file in QTEMP  and then
uses the system RSTOBJ command.

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

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

If the SNDOBJMAIL  command completes  normally, but  no E-Mail  message
arrives  at  the  destination,  try  SNDDST  by   itself.    Enter  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 the problems of an MSF job.

Mail Address Tool (MAILADR)
---------------------------

The  MAILADR tool  allows a  file  to be  created with  user names  and
E-mail  addresses.    When  the  default  is  used  for the  SNDOBJMAIL
MAILADRLIB parameter, the  MAILADRP file must be  on the library  list.

The SNDOBJMAIL  SENDTO parameter  defaults to  *SELECT which  means the
list  of users defined to  the MAILADR tool would  appear in a subfile.
One or more names 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
SNDOBJMAIL  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  section on
'Group names'.

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  an object  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:

          SNDOBJMAIL  SUBJECT(xxx) OBJ(xxx) LIB(ABC)
                        TEXT('...') SENDTO(*INT)
                        INTADR(www@xxx.zzz)

SNDOBJMAIL escape messages you can monitor for
----------------------------------------------

      TAA9896    No objects exist to be saved
      TAA9897    The stream file directory was not found

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

SNDOBJMAIL Command parameters                         *CMD
-----------------------------

   SUBJECT       The subject  of the E-Mail.   This information is seen
                 by the recipient as the subject of the E-Mail.

                 The subject may be up to 44 characters in length.

   OBJ           The name or generic  name of the  object to be  saved.
                 Up to 300  entries may be  made.  All objects  must be
                 in the same library.

   LIB           The library where the object(s) exists.

   OBJTYPE       The type  of object to be saved.   The default is *ALL
                 for  all types.   For a  list of the  valid types, use
                 the prompter.

   STMFDIR       The stream  file  directory.   This  is used  only  to
                 copy  the  save file  to  an  IFS  stream file.    The
                 default  is *HOME  meaning to  use the  home directory
                 stored in the  user profile.   A  home directory  must
                 be specified  in the  user profile  and the  directory
                 must exist.

                 A   directory   entry  may   be   specified   such  as
                 '/home/xxx'.

                 Up to 5000  characters may be  entered and mixed  case
                 is allowed.

   STMF          The stream  file  name to  be used.    The default  is
                 *LIB  meaning  the  same  name  as  the  library  name
                 entered.

                 Up  to 300  characters may  be entered  and mixed case
                 is allowed.

                 If the stream  file does not exist,  it is added.   If
                 it does exist, the data is replaced.

   STMFEXT       The  stream file  extension if  any that  is  added to
                 the IFS stream file name.  The default is '.SAVF'.

                 A  different  extension  may be  used  or  the special
                 value *NONE meaning no extension is added.

   DLTSTMF       A *YES/*NO  parameter  for  whether  the  stream  file
                 should be deleted after sending the E-mail.

                 *YES is the default to delete the stream file.

                 *NO may be specified to retain the stream file.

   DTACPR        A parameter  for whether  to compress  the data as  it
                 is  written to  the save  file.   The value  is passed
                 thru to the SAVOBJ DTACPR  parameter.  The default  is
                 *NO.

                 The other  values are *YES,  *LOW, *MEDIUM,  or *HIGH.

   TGTRLS        The  target  release  to be  used.    *CURRENT is  the
                 default  for the  current release.   Use  the prompter
                 to see the supported values.

   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  to  send  to have  been  selected, F3
                 should  be used  to return  to the  SNDOBJMAIL prompt.
                 The names of the  selected users are used to  fill 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 to  send to.   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  SNDOBJMAIL by
                 using   SENDTO(*INT)  and  then  entering  the  E-Mail
                 address in  the INTADR  parameter.  If  *INT is  used,
                 the second  part of the parameter  (Recipient type) is
                 blanked  and the  INTADR parameter  should be  used to
                 enter the recipient type.

   TEXT          The text  of  the  message  which may  be  up  to  256
                 bytes.

                 *GEN  is the  default meaning  the  text is  generated
                 from  the other  command parameters and  ADDIFSNAME is
                 set to *NO.

                 *NONE may be entered to prevent sending any text.

                 If a  text value  is  entered, no  special  characters
                 may be entered to help format the text.

   ADDIFSNAME    Whether and how to  add the name from the  IFS file to
                 the  value  specified  in  the  TEXT parameter.    The
                 default is *BEGIN.

                 *BEGIN  inserts the file name  at the beginning of the
                 TEXT parameter.    For example,  if the  defaults  are
                 used  by user  'joe',  to save  objects  from the  ABC
                 library,     the    IFS    file    name    would    be
                 ('/home/joe/ABC.SAVF')  and  TEXT('Here  it  is')   is
                 specified, the text read by the recipient would be:

                     ABC.SAVF - Here it is

                 *END inserts  the file  name at  the end  of the  TEXT
                 parameter.    For  example,  using  the  same  as  the
                 previous example, the  text read  the recipient  would
                 be:

                     Here it is - ABC.SAVF

                 *NO may  be  specified to  not add  any characters  to
                 the text read by the recipient.

   INTADR        If  SENDTO(*INT)  is  entered,  a  list of  up  to  50
                 internet E-mail 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.
                 This  parameter  only appears  if  F9 or  F10  if used
                 while prompting the command.

                 *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.


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

You must  have the  special authority *SAVSYS  or the  object existence
right to the objects being saved.

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

The following TAA Tools must be on your system:

     MAILADR         Mail address
     RTVHOMDIR       Retrieve home directory
     SAVOBJIFS       Save object to IFS
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDIFSMAIL      Send IFS mail
     SNDJLGMSG       Send job log message

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

None, the tool is ready to use.

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

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

   SNDOBJMAIL    *CMD                   TAAIFUF       QATTCMD
   TAAIFUFC      *PGM       CLP         TAAIFUFC      QATTCL
					

Added to TAA Productivity tools April 15, 2012


Home Page Up to Top