?
Solved

Sending Emails From An iSeries

Posted on 2008-10-16
5
Medium Priority
?
1,891 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 500 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 500 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
The Summer 2017 Scholarship Winners have been announced!
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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