Solved

Sending Emails From An iSeries

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

15 Experts available now in Live!

Get 1:1 Help Now