Is there a way to send an email from an iSeries terminal, adding an attachment from the IFS? I know how to send a normal email using the SNDDST utility.
There is two main methods of doing this.
Recent versions of the operating system come with the SNDSMTPEMM command already included. It's quite easy to use and allows you to include both a message body and an attachment simply by populating the appropriate parameters.
That is what I would recommend for anyone who has it on their system, and needs something simple and free. For more robustness, there is Brad Stone's MAILTOOL Plus, which is available as a paid subscription.
The below information is my original answer, slightly updated, mainly for historical purposes:
Where I work we use MMAIL. It's low-cost and provides easy-to-use commands. For example, I happen to e-mail stream files all the time as follows (within a CLP):
MMAIL/EMLSTMF SUBJECT('Monthly Sales Reports') + FROMNAME('AS/400') FROMADDR('[email protected]') + TO('[email protected]'/Jim Smith/*TO + '[email protected]'/Bob Jones/*CC) + STMF(&FILE1 &FILE2 &FILE3)
There are other parameters available as well (pretty self-explanatory if you use the interactive prompt), and several other commands to handle the most common use cases. The package does also provide an API if you want finer control, or need to send much more complex messages, but I have never needed more than the provided commands.
This utility used to be free, but the author now requires a "donation" of $50 for full access to downloads from his site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With