Command
mmail/crtmime
helps you in creating a MIME file and optionnally in sending it.
The MIME file is saved as IFS file in path /mmail/mime.
The MIME file is without any MIME Send an distribution headers.
This allows the user to send a given MIME file several times to
different recipients.
This page illustrates through an example the creation and the
sending of a MIME file.
In this example, I want to create a MIME file containing:
- a photo
- some text
- an attachment including the save file of an AS/400 library.
Note 1. You must be very carefull when creating a MIME file.
Once an action is accomplished, you cannot change it.
The only way out is to press F3 or F23 (if displayed))
and restart from the beginning.
1. Preliminary steps
The first screen sent by command
mmail/crtmime
asks you to give a name to your MIME file.
Please be sure to:
- NOT specify the path, NOT specify the extension.
They will both be generated by the utility
- type a file name that does not yet exist.
If you type the name of a MIME file that already exists,
the file will be cleared and overwritten.
Figure 1- Naming the MIME file
Note that the file was assigned path /mmail/mime
and extension .txt
Now it is the time of typing the Subject of the message:
Figure 2- Typing the Subject
the next three steps (we skip those obvious Figures) allow
to assign the
- Importance
- Priority and
- Sensitivity
of the message. Please note that sensitivity private does not
allow the recipient(s) of the message to either print or forward it.
After this, you receive the following screen:
Figure 3- Time to fill in the body of the message
2.Embedding an image
It is now time to fill in the body of the message with some contents.
Let us first embed an image (a photo). By "embed" we mean that
we do not want to attach it to the message, we want to have the image
open and visible with the message text.
To add a piece of contents (technically speaking: a body))
you must press F6:
Figure 4a- Selecting the content-type of a body
You are then requested to give the name of the existing IFS file
containing for the selected Content-type:
Figure 4b- Name of the IFS file to become a body
Last, you are requested whether you want to "embed" or "attach"
this part (body):
Figure 4c- Embedding a body
Figure 4d- A piece of contents (body) has been added
Worth to be noted that the image was physically copied into the MIME
file. Being a binary object, the image was copied in the BIN64 format
(a format where three EBCDIC bytes are transformed to 4 ASCII bytes).
3.Embedding some text
It is now time to add a second piece (body) of the contents,
Some text. Let us press F6 again
Figure 5a- Selecting the content-type of a body
We select Text/plain because it's the easiest way to
write some text. As a matter of fact, all mail products would use
Text/html instead, because it offers a lot of representation
facilities (fonts, colors, tables, lists, etc.).
However, as we are going to write our text without such a mail product,
and we are not supposed to know HTML, we select Text/plain
for the Content-type.
We are then requested, as before, to name the IFS file containing
some text/plain, to be merged into the MIME file.
As a matter of fact, we did not yet write that text, so we give the
name of a file that does not exist. The utility will create that file
and edit it (EDTF) to let us enter the text we need:
Figure 5b- Name of the Text/plain file to embed
Figure 5c- The text file was just created, but is still emty
Figure 5d- We typed in some text in the text file then ... F2 + F3
Note.If the text IFS file mentioned in Figure 5b
already exists, it is just displayed (not edited) to let the user
check its contents.
Figure 5e- Of course, this text must be embedded
Figure 5f- and now we have two body parts, both embedded!
4.Attaching a save file
Last, we want to attach a save file.
Press F6 to select the Content-type:
Figure 6a- For save files, select Content/type "other"
Your save file must have been transformed to an IFS file
(you may use command CpyToStmf for that):
Figure 6b- Specify the IFS file obtained from a save file
Figure 6c- Specify "attach" for the save file
Figure 6d- and now we have three body parts: two embedded, one attached
Of course, by choosing Content-type=other, the IFS save file
has been merged into the MIME file in BASE64 format.
The MIME file is now complete.
If you are curious, you may press F4 and
browse it.
5.Saving the MIME file
You should now press F3.
You will be asked whether to save this MIME file or not:
Figure 7- Save the MIME file?
You are then asked if you want to send the MIME file:
- If you answer N (No), this part of the utility ends.
You would be able to send this MIME file later, through command
mmail/sndmime
- If you answer Y (Yes), you would run the sndmime command
right away, see next.
6.Sending the MIME file
You must fill in your name and your e-mail address:
Figure 8- Fill in the sender's data
then you must specify whom the message should be sent to:
Figure 9- Must specify destinations
We press F6 to select some groups (distribution lists):
Figure 10- Selecting groups (distribution lists)
Please note the type of distributions:
- 1 = To
- 2 = cc (carbon copy)
- 3 = bcc (blank carbon copy)
Figure 11- Addressees so far
You may also press F7 to select individuals from the Address Book:
Figure 12- Selecting individuals from the Address Book
Figure 13- Addressees so far
When you are finished adding groups and individuals to message
distribution, press F10 to send the MIME file.
If you addressed your MIME file to some Groups,
you will receive the following screen:
Figure 14- Collapse / expand Groups
- Select collapse not to expand groups.
In this way you would not let the recipients know the names
and the e-mail addresses of the other recipientes.
This is a good rule to prevent spammimg.
- Select expand to have all names and
addresses from groups displayed to the receivers.
Some of the receivers may not like it.
After this, your e-mail is being sent.
If you want, you may display the MIME file built from this example.
7.Send yourself some MIME files
Why don't you try to send some MIME files to your e-mail address?
This will provide you some evidence of what you can achieve.
Just press this
button.
8.Some considerations
- Not a mail tool, just a prototype
This utility, made of commands like
wrkaddr, wrkgrp, crtmime, sndmime,
is far from the fine mail products that are available for PC's.
However, it includes a service program, with a number of
subprocedures for creating segments of the MIME message,
that can be used by your ILE-RPG programs to create and send
automated messages.
- Text/plain or Text/Html?
Text/Html provides a far better representation.
However, if you are not familiar with HTML, you may use
one of the many HTML authoring tools available on the market
to prepare on IFS files the text segments to be embedded
into your MIME files.
- Embedding or attaching binary files?.
As a general rule, binary files should always be attached.
Images may be embedded in the text, though not all the mail
products may support embedded images.
Embedding several fragments of text is never a problem.
Appendix A - Special support for database files,
source members, and spool files
In order to allow for embedding / attaching database files, source members,
and spool files, three fictitious "content-types" are provided through
command mmail/crtmime:
- text/database-file
- text/source-member
- text/spool
Content-type text/database-file
By selecting this content-type you will receive a special window
that allows to import a database file member.
The database file member is copied to a source file member, then
the source file member is copied to a stream file.
When embedding / attaching the source member to the MIME file,
the content type assigned is text/plain.
Note.
Only the initial 2,000 bytes of each record
are taken. Non-character data are taken "as is".
Content-type text/source-member
By selecting this content-type you will receive a special window
that allows to import a source member (the source member will be copied to an
IFS stream file). When embedding / attaching the source member to the MIME file,
the content type assigned is text/plain.
Content-type text/spool
By selecting this content-type you will receive a special window
that allows to import a spool file (the spool file will be copied to an
IFS stream file). When embedding / attaching the spool file to the MIME file,
the content type assigned is text/plain.
Note.
You may ask a spool file to be converted to PDF
(please check the prerequisites).
Spool files converted to PDF's are added as attachments.
|