Solved

Sending Emails From An iSeries

Posted on 2008-10-16
5
1,734 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now