Most of us today use e-mail as our primary communication vehicle. The iSeries has built-in support for e-mail facilities that allow you to use the POP (Post Office Protocol, for inbound e-mail) server and/or the SMTP (Simple Mail Transport Protocol, for outbound e-mail) server. It’s quite nice to get an e-mail from an iSeries application program when an event occurs that you want to know about. You can also use e-mail as a means of report distribution.
iSeries e-mail does require some configuration steps. Thankfully, IBM has created a Web page that contains iSeries e-mail information and links to everything there is to know about the topic.
With the above Web page as a starting point, it can be quite simple to get up and running on iSeries e-mail.
When a user is registered on the iSeries as an SMTP user, a directory entry is made using the WRKDIRE (Work with Directory Entries) command. This is where you specify the user’s e-mail address. But once in the directory, there is no easy way to get the e-mail address into a program. This problem was the inspiration behind the commands presented in this issue.
Download the save file containing the source code.