Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Sending Emails From An iSeries

Posted on 2008-10-16
5
1,789 Views
Last Modified: 2012-05-05
I would like to send an email from the iSeries, and incorporate this in an CL program. What would be the process to do this?
0
Comment
Question by:Lee_Williamsiii
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
daveslash earned 125 total points
ID: 22733087

the following command works for me ...

HTH,
DaveSlash

SNDDST TYPE(*LMSG)
 TOINTNET((myEmailAddress@MyDomain.com))
 DSTD(NOTIFICATION)
 LONGMSG('Here is the email message')
 SUBJECT('the subject line')

Open in new window

0
 

Author Comment

by:Lee_Williamsiii
ID: 22733356
I tried it in a CL program and get an error message CPF9D03. An internet address was specified in the tointnet parameter but there is  no route SMTP gateway.
0
 
LVL 18

Expert Comment

by:daveslash
ID: 22733435

Try it directly from the command line. It may give better error messages.

I'm sorry I can't be more help. I don't know how to configure SNMP. I just know how to use it.

-- DaveSlash
0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 125 total points
ID: 22734862
Lee_Williamsiii:

There are many ways of doing it, depending on where you want the e-mail to go, what version of i5/OS (OS/400 or IBM i) you have, what configuration(s) you're allowed to change, how comfortable you feel with programming (in CL; or better, in ILE CL; and best, V5R4 or later ILE CL).

The "native" interface for CL would be the SNDDST (Send Distribution) command. This was designed for SNA/DS (where DS = 'Distribution Services') which was appropriate in internal medium/large "business" networks, so it's not directly useful for SMTP which is more appropriate for external internet e-mail.

IBM worked out and provided a kind of 'gateway' process that could route distributions back and forth between the SNA/DS functions used natively and SMTP functions that would interface with external e-mail servers.

From that, the 'normal' steps would be to configure your SMTP and POP services to communicate with the outside world, configure a minimal SNA/DS structure for your CL to talk to, and, finally, configure the 'gateway' between the two. Some general links:

http://www.easy400.net/tcpcfgh/page02.mbr
http://www.ariadnesoftware.co.uk/EmailSetup.pdf
http://faq.midrange.com/data/cache/192.html

Plenty info is available from IBM on all of the parts of that, of course.

A second route would be to locate, download and install a utility that simply knows how to talk either to your SMTP server without using the 'gateway' or directly to external e-mail servers. Examples:

MMAIL --
http://www.easy400.net/easy400p/maindown.html#d13
SNDM (scroll down the page) --
http://homepage1.nifty.com/uzaemon/index.html

Third would be to do some programming. The javamail APIs could be used; but if you must stick with CL, you'd need to learn the QtmmSendMail API plus probably either the various HFS APIs (in order to write to the documents) or the user space APIs (also to write strings that can become documents). With V5R4 and ILE CL, you could do all necessary I/O directly with IFS streamfiles and ignore HFS and user space APIs.

Finally, if you really wanted to be fancy, it's not particularly difficult to write SMTP clients. It's certainly not appropriate in less than V5R4 ILE CL; but from then on, it's about as "easy" as sockets programming gets.

How would you expect to proceed?

Tom
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question