Solved

Sending Emails From An iSeries

Posted on 2008-10-16
5
1,849 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
[X]
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
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
Dave Ford 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:Dave Ford
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
Here's how to start interacting with our community through Post.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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