Problem solve Get help with specific problems with your technologies, process and projects.

Send e-mail message from CLP

Send an e-mail message from CLP. Use this method to notify key personnel when certain events take place.

I use this method to notify key personnel when certain events (or error conditions) take place. For example, a file has been sent or received, or a critical job step has completed or, more importantly, has encountered an error.

The first thing you need to do is make sure that there is an entry in the system directory for each person you want to send a message to. Note, they do not need to have an iSeries 400 user profile to be listed in the system directory. Add a user ID, address and description. The system name must be TCPIP. Leave the group blank. Page down and change the Mail Service Level to 2 = System message store and the Preferred address to 3 = SMTP name. Press F19 to change the SMTP name. Enter the e-mail address in the user ID (the part before the @) and the domain name (the part after the @). For instance: for my e-mail address:, I entered:

SMTP user ID . . . . . . jevans
SMTP domain . . . . . . . AGIA.COM

Now you are ready to add the e-mail message to your CL. In a CL program enter the Send Distribution command: SNDDST and prompt (F4). Enter *MSG for information to be sent, the user ID and address to send to (from the system directory), a description (this becomes the subject of the e-mail) and the message to send.

That's all there is to it. You can also create a distribution list to send to multiple user IDs. You just use the distribution list ID in the user ID and address on the SNDDST command and the message will be mailed to each user on the list.

Also, if anyone is interested I have created a command, SNDEMAIL, that uses a message file and reference file to build the list of users and send messages so I do not need to hardcode user IDs and messages in my CL programs. Write to me, Jim Evans and I will send the code for the command and CLP to anyone that would like to see it.


The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.

Dig Deeper on Implementation