I've recently seen a lot of tips on "Sending messages from your iSeries via SMTP." While all of these tips are valid, to me they contain one vital flaw. They all require your iSeries to be running the SMTP server daemon. While this might be OK for some, in most shops today with heavy security requirements, our shop included, running services on servers that are not required for strategic operations is prohibited. i.e.: No FTP or SMTP unless you can prove 110% there is no other way.
If you find yourself in this situation, do not despair. Turn that "DOH", into a "WHO HOO" ;P
There are a few products out there that can send SMTP messages to a server without the SMTP server daemon running on your iSeries. Some are freeware, some are shareware, and some are just too much money for what you get.
You can go the vendor software route like the other thugs in "Sector 7 G" or you can write your own application to send messages via SMTP WITHOUT a lot of money or time.
How do I do this you ask? Simple, you use the IBM TCP/IP Socket Client APIs.
The TCP/IP Socket Client APIs, supplied with a complete programming guide and packaged as a stand-alone library, are comprised exclusively of middleware which provides the TCP/IP data exchange and other interfaces for socket programming. The APIs offer ease of implementation of a client application and calls to the APIs may be written in any iSeries high-level language including RPG, COBOL and C. With a little effort, a working sockets application can be tossed out in no time.
Now that you know what the TCP/IP Socket Client APIs are, where do you get them?
Here is the how to in five simple steps:
1. Logon to the IBM Client Technology Center (CTC) website.
2. Request a freeware copy of the IBM TCP/IP Socket Client APIs.
Yes that is right, FREEWARE and IBM sometimes do occur.
3. Go for a break and await the e-mail from IBM.
4. Upon arrival of e-mail and related software, read the complete Programming Guide supplied by IBM. "AS/400 General Purpose TCP/IP Socket Server II Programming Guide" This step cannot be skipped. If you do not read the manual then you will be out of luck.
5. Using the example code provided, modify, compile, and "Wa La" your SMTP solution.
For purposes of this tip, there is no way I can provide you with a "Monkey Can Key It In Solution". (McKiis) With a solution available in RPG, C, COBOL or even CL if you wished to push the envelope I would never have enough space.
What I can provide you with is the location of the APIs listed above. A bit of reading, a little thought and maybe a donut or two, most administrators with some RPG or C skills should be able to implement this process or at the very least evaluate this solution to decide if running a SMTP server daemon on the iSeries is worth the risk and overhead or if this solution will fit the trick.
Another day...another code cut. The cosmic ballet... goes on.