top Content-type: text/html Expires: 0 MIME & Mail
Skip to main content  
  Easy400   |       iSeries home   |   RSS feed
Freeware
 
Introduction
5250 utility
Windows utility
Other utilities
Service program
Sample code
Commands
CGI support
FAQ
WEBMail
Self maintenance
 
Download
 
 

 
Search   
iSeries MIME & Mail


This free utility (library MMAIL) allows to create and mail MIME (Multipurpose Internet Mail Extensions) files.
It is authored by Giovanni B. Perotti, Italy.

The contents of these pages are related to the release dated /%datereleased%/.

If you want you may download a PDF containing the whole MMAIL documentation.

You've Got Mail!, an introductory article by Susan Gantner and Jon Paris, on the eServer Magazine, iSeries Edition, October 2004.

1. Prerequisites, contents, distribution, updates
2. Objectives
3. About MIME files
4. About QtmmSendMail API
5. MIME & Mail 5250 Utility
6. MIME & Mail Windows Utility
7. MIME & Mail miscellaneous utilities
8. SendMail service program
9. Commands
11. Duplicating an MMAIL installation to other systems
11. Development libraries
12. Cloning library MMAIL
13. Troubleshooting and FAQs
14. WEBMail
 
 

Why don't you mail yourself some of the MIME examples we have?

Just press this button.

 




  1. Prerequisites, contents, distribution, updates
Prerequisites

  1. Minimum requirement is OS/400 V5R1. However, AMailer (the WebMailer included in MMAIL) requires at least V5R2 to be compiled.
  2. RPG-ILE compiler (just for the installation)
  3. Library QHTTPSVR (product 5722DG1)
  4. Library QSYSLOCALE (product 5722SS1 option 21) from V5R4 on (see page http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/nls/rbagswhatsnew.htm )
  5. Library QFNTCPL (AFP Compatibility Fonts, product 5722SS1, option 8, feature 5050) required for conversion of spool files to PDF's.
  6. Library QCTX (AFP to PDF transform, product 5761TS1 options *BASE and 01) required starting V6R1 for using the "i5 OS AFP TO PDF TRANSFORM", see this page.
  7. System value QCCSID must NOT be 65535.
  8. Though not strictly necessary, for best conversion of spool files to PDF's we recommend to install "IBM Infoprint Server for iSeries, 5722-IP1" (library QIPS). For information about the MMAIL & Infoprint Server interface check out this page.
  9. System value QRETSVRSEC.
    Access to the webmail application AMailer is through validation lists. If you plan to use this webmail application, then you must set system value QRETSVRSEC to 1.
Contents
  1. MMAIL is the base library.
    Two more libraries (HPT and TIFFLIB) are available. These libraries support the conversion of a spool file to a pdf.
    While library HPT is installed if the OS/400 release is at least V4R5, library TIFFLIB is installed only if the OS/400 release is at least V5R1.
  2. Service program mmail/sendmail is the base for all services provided. The functions of this service program for your own developments, are used in many utilities available in the package, and are documented in a separate page
  3. A general 5250 utility can be run via command mmail/mimemenu. It allows to:
    1. maintain an address book
    2. maintain groups (distribution lists)
    3. create a MIME message (some times also called "MIME file")
    4. send a MIME message
    5. maintain a catalog of existing MIME messages
    The functions of this utility are documented on separate pages. They provide very good examples of interfacing the base service program.
  4. A similar, very friendly utility is also available for Windows. This Client/Server utility requires Client Access Express and operates via service program mmail/wsendmail. It is documented on a separate page.
  5. A number of other commands are available through menu go mmail/mail. See this page for details. These commands can be easily used in your application programs. They allow to:
    1. e-mail a simple message
    2. e-mail a source member
    3. e-mail a spool file
    4. e-mail a save file
    5. another utility allows to capture given spool files from one (or more than one) output queues and to e-mail them to different distribution lists (groups).
Note 1- All functions supporting e-mailing of spool files include the ability to convert spool files to PDFs.
Note 2- The base service program includes the ability to customize messages by assigning values to user-provided variables. See procedure MimeUpdTxt.
Note 3- All iSeries programs and service programs are implemented either in ILE-RPG or CL. All sources are delivered. If you need to apply changes to a service program, you should run command mmail/compile after applying changes.
Sources are also available for the Windows Client/Server utility.
Distribution
Library MMAIL can be downloaded at no charge from the Easy400 site.
Updates
Whenever updates are necessary a new MMAIL version is released. Each MMAIL version has its own release date.
  • The current MMAIL version available is dated /%datereleased%/
  • To know the release date of the MMAIL version currently installed on your system, enter command MMAIL/RELEASED .
A list of changes in maintained in member MMAIL of source file MMAIL/WHATSNEW.
Press here to display the latest changes.
If you want, you may download and install at your own responsibility single sources of MMAIL using the self-maintenance tool.

  2. Objectives
By using this support you will be able to
  • Create MIME files embedding texts and images, and appending various type of attachments (source members, spool files, images, audios, videos, and any other type of binary objects, for instance OS/400 save files)
  • Send MIME files to addresses selected from an Address Book, and/or to selected Groups (distribution lists)
After reading our service programs functions, you will be able to
  • write your own ILE-RPG programs to handle outgoing mail messages
  • write your own ILE-RPG programs to send out customized messages


  3. About MIME files
Multipurpose Internet Mail Extensions are a set of standards defining a message representation protocol. These standards have grown up since 1982 through a number of RFC's (Request for Comments). Two major of them are listed here:
Aug. 1982 RFC822 Standard for the format of ARPA Internet Text Messages
Sept. 1993 RFC1521 Mechanisms for Specifying and Describing the Format of Internet Message Bodies
Other references: Multipurpose Internet Mail Extensions
Media types
Image media types (IANA)
Audio media types (IANA)
Video media types (IANA)
In brief, usually a MIME document is made of:
  • A number of top headers describing sender, date, MIME version, distribution, subject, importance, priority, and sensitivity of the document:
    Sender: as400man@chris.com
    Date: Wed, 09 Oct 2002 19:08:25 +0100
    From: Mike Shumaker <as400man@chris.com>
    MIME-Version: 1.0
    To: Sergei Bertolds <sergiob@argo.com>
    Subject: Some examples
    Importance: medium
    Priority: normal
    Sensitivity: normal
  • A Content-type header describing the document as MULTIPART/MIXED. This means that the document may contain more than one piece (for instance some text and an attachment) and that the single pieces may have different types.
    The same header contains another keyword, BOUNDARY; it defines the boundary line that will be used to separate the single pieces.
    Content-Type: MULTIPART/MIXED; BOUNDARY="--PART.BOUNDARY.1"
  • The body of the message, usually some text, between boundaries and preceeded by appropriate Content-Type and Content-Disposition headers:
    ----PART.BOUNDARY.1
    Content-Type: text/plain; charset=US-ASCII
    Content-Disposition: inline

    Hello Sergei

    please find attached the example we were discussing today.

    Kind regards,
                     Mike
  • One or more attachments, as follow:
    ----PART.BOUNDARY.1
    Content-Type: application/octet-stream; name="example.exe"
    Content-Disposition: attachment; filename="example.exe"
    Content-Transfer-Encoding: base64
    Content-Description: example.exe
    (copy of the binary object translated to Base64 format)
We suggest you visit another example.
Note 1. "Base64" is a standard way of embedding binary objects into ASCII MIME files. This is done by translating chunkes of 3-EBCDIC bytes to chunkes of 4-ASCII bytes. Our utility includes a function that performs this kind of translation.

  4. About QtmmSendMail API
MIME files must be sent via the QtmmSendMail API. This API allows for multiple distributions.
For more information see this page.
Note 2. Our utility includes a function interfacing the QTmmSendMail API.

  5. MIME & Mail 5250 Utility
Creating MIME files and sending them via the QtmmSendMail API is not extremely easy. This is why we provide our MIME & Mail Utility.
This utility, while provides solutions for some initial mailing cases, through its code provides examples for writing your own code, if you wish or need to.
The utility is started from a 5250 session by entering command
     mmail/mimemenu
You will receive the following screen:
MIME files Menu
Select one of the following:
1. Work with Address Book WRKADDR
2. Work with Groups WRKGRP
 
3. Create (and send) a MIME file CRTMIME
4. Select and send a MIME file SNDMIME
5. Work with MIME files WRKMIME
 
6. Example of customized letters CUSTMAIL
 
Selection:   

F3=End F12=Cancel
See the 5250 Utility tutorial pages.

  6. MIME & Mail Windows Utility
A similar utility is provided for Windows. Through Client Access Express API's it would communicate with an iSeries service program to provide similar services.

See the Windows Utility tutorial page.



  7. MIME & Mail miscellaneous utilities
Service program MMAIL/SENDMAIL allows to create your own mail utilities in a very easy way. However, it may happen that some interesting mail utility is suggested from our users. Any such utilities are embedded in library MMAIL and documented in page "Other utilities".

  8. SendMail service program
To make our utility easy to read and to maintain, we have isolated a lot of functions into the MMAIL/SENDMAIL service program.
These functions are the ones you need in order to write your own mail-management programs.
See the SendMail service program page.

  9. Commands
Library mmail contains several commands. A separate page provides a quick summary of all available user commands.

  10. Duplicating an MMAIL installation to other systems
Once you have installed MMAIL on your iSeries (AS/400) system (equipped with the RPG-ILE compiler), you may duplicate the installation to other iSeries (AS/400) systems, even if they are missing the RPG-ILE compiler. This is how you do it:
  1. On the system where MMAIL was originally installed:
    1. save library MMAIL
  2. On the target system:
    1. logon with a user profile having USRCLS(*SECOFR)
    2. restore library MMAIL
    3. run command "addlible mmail"
    4. run command "call mmail/install"


  11. Development libraries
Never create local objects (program, files, etc.) in library MMAIL, because you would loose them when installing a new release of library MMAIL.

If you plan to develop programs using subprocedures of MMAIL service programs, you are recomended to:

  1. Create your own development library, do not use library MMAIL.
  2. You have two ways to populate your development library with the objects you need to develop MMAIL-based programs:
    • Use command MMAIL/SETMAILLIB to populate your library with duplicates of MMAIL service programs, binding directories and QRPGLESRC /COPY members
    • Use comand MMAIL/CRTMMLIB (see the next topic, Cloning the MMAIL library) to clone your library with the same contents of library MMAIL
  3. When you create and run your programs, make sure that they refer to the service programs in your library, not to the service programs in library MMAIL. You do that by removing MMAIL from the library list, and adding your library instead.
Besides, by doing this you will not experience any "service program signature errors" when you install a new version of MMAIL.

  12. Cloning the MMAIL library
Some developers would like to customize the services provided from library MMAIL to their own needs. However, at the same time they may need to download the refreshes of library MMAIL.
The ability to create, on the same system, clones of library MMAIL would result in some advantages for developers:
  • customize a clone for the needs of a given application, while making it non-sensitive to future MMAIL updates
  • ability to install new versions of library MMAIL and to create new clones from there
Command mmail/crtmmlib allows to create a new clone of library MMAIL, or of a cloned library. Execute it after adding to the job library list
  • either library MMAIL
  • or the name of a cloned library
This library will be the master for the new cloned library.
           Create another MMAIL library (CRTMMLIB)

Type choices, press Enter.

New MMAIL library  . . . . . . .  NEWLIB  __________    Name
Recompile programs . . . . . . .  COMPILE *NO_          *NO, *YES
  • use parameter NEWLIB to specify the name of the cloned library. This library must not exist.
  • enter *YES for parameter COMPILE if you want the programs in the cloned library to be re-created. By doing this, you will be able to run STRDBG on them.


  13. Troubleshooting and FAQs
Some troubleshooting FAQs are available at our FAQ page.

  14. WEBMail
Starting July 2007, MMail includes a free open source WEBMail utility, named AMailer.
It is an iSeries WEB Mailer which (like many commercial mailers for PC) allows to receive and send e-mail messages.
AMailer supports multiple users and is fully integrated with MMail.
An AMailer tutorial is available.



    Contact