Strategi Email Quickstart Guide - SNDSGISMTP

Product: Strategi
Modified Date:


The Strategi command SNDSGISMTP was added to provide basic email support for both interactive sessions and programs. The most common application is adding email functionality to HSM programs such as website registration, process confirmation, monitoring etc. The SNDSGISMTP command supports the transmission of email only and relies on the proper configuration of the iSeries 400 Mail Server Framework (MSF) and SMTP services. The SNDSGISMTP command simply passes a MIME formatted message to the iSeries 400 mail server framework to be processed.

iSeries 400 Configuration
The configuration of the iSeries 400 to support SMTP outbound email is dependent on each unique system requirement. The elements involved include but may not be limited to the following, which are all options available using the CFGTCPSMTP command on the iSeries 400 (requires *IOSYSCFG authority).
  • System Alias Table
  • Personal Alias Table
  • SMTP Attributes
  • Directory Entries
  • Distribution Queues
  • Distribution Services
    Refer to the TCP/IP Configuration and Reference (document number SC41-5420-03) for assistance in properly configuring the iSeries 400 SMTP function.

    Common Usage Examples
    The SNDSGISMTP command can be used in a variety of ways dependent on customer requirement. The command parameters and their descriptions are detailed for each parameter, which may be viewed by prompting SNDSGISMTP and pressing F1 on each command parameter. The following examples illustrate the various ways this command may be implemented. In addition, all command parameters may be substituted with appropriate program variables.

    Interactive/Batch Text Email
    The following example will send a simple text message.
    SNDSGISMTP TO(user@abc.com)                +
               FROM(sender@xyz.com)            +
               SUBJECT(this is the subject)    +
               MSGHDR(this is the message body)
    

    OS/400 DB File Include
    The following example will send an email with the message being the contents of an existing iSeries 400 database file. The limitation is that the iSeries 400 database file be less than or equal to 80 characters in length. Multi-field record formats are not supported (i.e. flat file format expected).
    SNDSGISMTP TO(user@abc.com)                 +
               FROM(sender@xyz.com)             +
               SUBJECT(this is the subject)     +
               MSGHDR(this is the message body) +
               MSGFIL(&LIB/&FIL)                +
               MSGMBR(&MBR)
    
    The resulting email message body will append the contents of the database
    file any text specified on the MSGHDR parameter.
    

    IFS File Attachment
    The following example will send a simple email with a IFS file attachment. All attachments are sent using base-64 encoding and are currently limited to approximately 6MB in size.
    SNDSGISMTP TO(user@abc.com)                 +
               FROM(sender@xyz.com)             +
               SUBJECT(this is the subject)     +
               MSGHDR(this is the message body) +
               MSGATT(/path/of/IFS/file)
    
    Transmission of existing user binary files such as images, spreadsheets and sound files can be transferred using the procedure above. There are times when users wish to email iSeries 400 database files as attachments to an email message. Doing so requires copying the database file using the CPYTOSTMF command to a location on the '/' file system with the appropriate database file CCSID and stream file codepage. The resulting file may then be used for the MSGATT parameter on the SNDSGISMTP command. If these values are not correct, the email will not be readable by the client.

    ** End of Technical Support Bulletin **