|
|
All AS/400 Tip Categories
/
Email /
Retrieving SMTP Name
Question:
I want to create a cgi program (in RPG IV) to create a dynamic page of
all users' e-mail addresses. I haven't been able to find an API (or
command that output to a file) to retrieve SMTP names. I can use
WRKNAMSMTP to display them on screen and DSPDIRE to and outfile to
retrieve proper name information, but no SMTP name. Anyone point me in
a direction?
Answer(s):
Look at my AS/400 home page for sample code
http://www.robin.no/~nfisketj/srvdire.rpgle
Since you put up an ILE RPG example, I thought a CLP would be nice to
compare against. Having more or less the same thing in two radically
different languages using differing techniques might make the API easier
to figure out. It isn't one of the nicer APIs to make work on your own.
The CLP can be found at:
http://zap.to/tl400
under Files/View my files.
The CLP accepts a system distribution directory user ID and address and
returns the associated SMTP address. It does not include any handling of
the API's error code; it's just a program I put together for my own use.
You can find all defined SMTP names in QUSRSYS/QATMSMTPA.
Before accessing QATMSMTPA, you might want to check out the note from Preventive
Service Planning (PSP) Information SF98036 for V4R3:
The SMTP files QATMSMTP and QATMSMTPA in library
QUSRSYS should not be modified directly or used to replicate SMTP information to
other systems. These files may be removed at some future release and you
should change any application you have that modifies these files. For more
information on how to change SMTP data, see the OS/400 TCP/IP Configuration and
Reference, SC41-5420.
|