tnt400.com - AS/400 Tips And Techniques

Sponsored by news400.com

This page is a discussion on the mentioned topic.
Most of the answers are in their original posted form, including any technical/spelling/grammatical errors.
No guarantees are expressed or implied. :-)
Comments, corrections, concerns about this tip?

Got another AS/400 question? Ask it here


What's New?
See what's new at Tips-N-Tech.

AS/400 Tips-N-Tech
AS/400 tips, techniques, and FAQ. Updated frequently.
CODEPage/400
All the code samples you can eat! RPG, CL, DDS, etc. etc.
AS/400 FAQs
The official news400.com FAQs.






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.


You are at a news400.com site.
Contact Us | Report Bugs | Submit Comments/Suggestions | Read Site Use Agreement | Read Privacy Policy
Copyright © 2000 Duke Communications International.
This site is best viewed with the latest versions of Netscape or Internet Explorer, 800 x 600 resolution (or higher), and at least 256 colors.
Duke Communications   NEWS/400 | 29th Street Press | Business Finance | DominoPro | Selling AS/400 Solutions | SQL Server Magazine | Windows NT Magazine