Sending E-Mail From the AS/400

The AS/400 has some reasonably good e-mail facilities built-in, however there are times when it's still easier to be able to send e-mail from within Python, particularly when you have to use any kind of custom formatting that exploits Python's strengths.

 

The module listed below will send an HTML formatted e-mail (no specific HTML formatting included, that's part of the "text" spec) to the specified address. Be sure that the "sender" address is at least a valid domain for your e-mail server, otherwise the server may reject it.

 

To use this module, you would simply call:

SendEmail('myname@mydomain.com','AS400 <test@mydomain.com>','Hey, it works!','Message body here!')

 

Here's the module: