tags:

views:

838

answers:

4

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.

+3  A: 

There is two main methods of doing this.

  1. The Do-It-Yourselfer will use QtmmSendMail API
  2. Otherwise there are several other free and purchased products that you could use. The ones I would recommend are:
    • MAILTOOL - Currently $399. Depending on what you are trying to do, I would recommend SplTool Suite if you want to email out spool files.
    • RPGMail - Free API making use of JavaMail
Mike Wills
+1  A: 

You could code your own program with Java and the JavaMail API.

Paul Morgan
+2  A: 

I have not looked in a while but there should be some unixy mail utilities on i5/OS that QSH could use. If not, it's supposedly a simple matter to port one. Look here for ideas: http://www.shelldorado.com/articles/mailattachments.html

But I like the JavaMail idea better. Just a quick google yields a site that has examples of JavaMail usage: http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html

With JavaMail you can also read mail if that could also be useful.

Update: You say you can already add attachments from the IFS. The command CATSPLF (part of QSH utilities) can retrieve spool files and write them to standard output. Which means you can transfer spool files to the IFS. But you have to know a lot about the job that created them.

Like:

    catsplf ... > /my/files/path
I found this at http://www.mcpressonline.com/tips-techniques/cl/techtip-read-printer-output-with-qshell.html. CATSPLF was introduced in V5R3.

Allen
A: 
John Y