The command APF3812/SNDEML is a newer version of both the APF3812/SNDMAIL and SNDEMAIL commands with the main difference, that the SNDEML command is able to send to multiple receivers:
Send email (SNDEML)
Type choices, press Enter.
To email address: TOADR _ Email address . . . . . . . . ___________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ ___________________________________ Name . . . . . . . . . . . . . *NONE______________________________________ ______________________________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ ______________ + for more values _ Subject . . . . . . . SUBJECT *NONE______________________________________ ______________________________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ Email-ID . . . . . . . MAILID *NONE
More... F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
Message . . . . . . . MSG *NONE______________________________________ ___________________________________ *NONE, *STMF, *BLANK + for more values ___________________________________________ ___________________________________ Message stream file . MSGSTMF ___________________________________________ ______________ Message variables . . MSGVARS ___________________________________________ ______________________________________________________________________________ ______________ + for more values
Mail text format . . . MAILTXTFMT *TEXT *TEXT, *HTML Mail text adjustment . MAILTXTADJ *NONE__ *NONE, *CENTER, *RIGHT
More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
Mail text embedded images . . . MAILTXTIMG *NONE
+ for more values
Attachment . . . . . . . . . . . ATTACH *NONE
+ for more values
More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
From email address: FROMADR MyMail@interform400.com
Name . . . . . . . . . . . . .
Hold email . . . . . . . . . . . HOLD *NO *NO, *YES Save email . . . . . . . . . . . SAVE *NO Confirmation of delivery . . . . CFMDEL *NO
More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
X-headers: XHEADER Keyword . . . . . . . . . . . *NONE
Value . . . . . . . . . . . .
+ for more values Index . . . . . . . . . . . . . IDX *NONE + for more values Index library . . . . . . . . . IDXLIB Archive directory . . . . . . . ARCDIR Archive . . . . . . . . . . . . ARCHIVE More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
Item type . . . . . . . . . . . ITMTYPE Data: DATA Field . . . . . . . . . . . . Value . . . . . . . . . . . .
+ for more values
More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
Additional Parameters CC email address: CC
Name or group . . . . . . . . *NONE
More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Send email (SNDEML)
Type choices, press Enter.
BCC email address: BCC
Name or group . . . . . . . . *NONE
OutBox directory . . . . . . . . OUTBOXDIR
Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
Type ‘+’ in TOADR, CC or BCC if you want to add another receiver.
The message can be typed into the MSG field or you can refer to an html file in the IFS if you type *STMF in the MSG field and type the stream file name (html file) in the parameter MSGSTMF. You can even substitute any variable (*V1-*V9) typed either in the MSG text or in the SMTF referred to via MSGVARS. The first lines added as MSGVARS is substituted for *V1 the next for *V2 and so on..
Mail text format (MAILTXTFMT) indicates how the message of the e-mail is to be sent - either as simple text (in a fixed font) or with html commands within.
If you are specifying your own html either in the MSG parameter or in the referred html file, then you can also embed local images directly in the html - instead of linking to images, that are globally available.
A video explaining this is included here.
You can do that in two ways:
1. State a directory in which all the local images inside the html are stored in the MAILTXTIMG parameter. The html should then only refer to the image file names like e.g. <img src="bottom-banner1.jpg">.
2. List the images in the MAILTXTIMG parameter like:
MAILTXTIMG('/pcdata/temp/png/Interform-01-01.png' '/pcdata/temp/png/as400.jpg')
- and refer to the images by the number in the MAILTXTIMG parameter list inside the html e.g. like so:
MSG('<b>This email is from InterForm 400! :)</b><br>'
'Here is an image:<br>'
'<img src="cid:image1" alt="Manual"><br>'
'Here is another image:<br>'
'<img src="cid:image2" alt="AS400">')
Remember to specify the FROMADR as the default value, *CURRENT will refer to the email information stored in system directory of the user running the current job. If you forget you might get this error message:
Additional Message Information
Message ID . . . . . . : APF4705 Severity . . . . . . . : 00 Message type . . . . . : Information Date sent . . . . . . : 06/01/14 Time sent . . . . . . : 14:33:29
Message . . . . : No email address for sender (<USERID>) exists. Either specify an email address for the sender, or add the preferred name, SMTP user ID and SMTP domain (email address) to the system directory for user KSE. Use the Work with Directory Entries (WRKDIRE) command to add the user information, if you prefer to use the system directory.
|
To solve this error you need either to specify the sender or alternatively update the needed information for the user profile running the current job e.g. via WRKDIRE.
If you want to send to an email group, you should state it like ‘TOADR((*GROUP SALES_GRP))’, where MAIL_GRP is the name of the email group defined (written in capital letters).
HOLD
Holds the email. It will appear in the mail log with status= Held, from where you can send it later. This option is only supported for InterForm SMTP.
SAVE
Saves a copy of the email in the /APF3812Mail/Log directory.
For archiving in InterArchive you should use the parameters:
ARCHIVE |
The archive to archive in. |
ITMTYPE |
The Interarchive Item type to archive as. |
DATA |
Fields and corresponding data to use for archiving. |
OUTBOXDIR
states the subdirecory (if any) to use (inside /APF3812Home/OutBox) to store the e-mail. If you state *CURUSR the directory will be the same as the owner of the original spooled file. The subdirectory will be created automatically, if it does not exist.
Note: In the ATTACH parameter you state the path and file name of the files you want to attach to the email. Up to max. 30 files can be attached.
The XHEADER field is described here.
MAILID
The mail-ID parameter can help you, if you afterwards want to identify the .eml file in the IFS, that created by InterForm400 or if you e.g. want to check out the status of this email. The Mail-ID should be a unique key (up to 30 characters are supported), that later can be used in an SQL. This is all covered here.