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
November 5, 2008.
A PDF containing all these WEB pages is available at
http://www.easy400.net/mmail/manual/MMAIL_manual.pdf .
You've Got Mail!, an introductory article by
Susan Gantner and Jon Paris, on the eServer Magazine, iSeries Edition, October 2004.
|
|
| |
| |
Why don't you mail yourself
some of the MIME examples we have?
Just press this
button.
|
|
|
|
1. Prerequisites, contents, distribution, updates
Prerequisites
- Minimum requirement is OS/400 V5R1. However, AMailer (the WebMailer included in MMAIL) requires at least V5R2 to be compiled.
- RPG-ILE compiler (just for the installation)
- Library QHTTPSVR (product 5722DG1)
- 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 )
- Library QFNTCPL
(AFP Compatibility Fonts, product 5722SS1, option 8, feature 5050)
required for conversion of spool files to PDF's.
- System value QCCSID must NOT be 65535.
- 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.
- 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
- 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.
- 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
- A general 5250 utility can be run via command
mmail/mimemenu. It allows to:
- maintain an address book
- maintain groups (distribution lists)
- create a MIME message (some times also called "MIME file")
- send a MIME message
- 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.
- 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.
- 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:
- e-mail a simple message
- e-mail a source member
- e-mail a spool file
- e-mail a save file
- 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 November 5, 2008
- 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:
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:
- On the system where MMAIL was originally installed:
- save library MMAIL
- On the target system:
- logon with a user profile having USRCLS(*SECOFR)
- restore library MMAIL
- run command "addlible mmail"
- 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:
- Create your own development library, do not use library MMAIL.
- 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
- 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
As a rule, one should not expect everything running smoothly from the very beginning.
Most frequent initial problems have to do with:
IBM iSeries Infocenter page Troubleshooting e-mail provides a simple scheme to address most common cases.
Last, to solve particular e-mail problems, you may use the MMAIL CGI program DSPQZMFDTA to display the current entries of the QZMF journal.
13. FAQ (Frequently Asked Questions)
Some of the most
frequent questions asked by MIME & Mail downloaders.
15. 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.
|