× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm successfully using Javamail with RPG?  Here's some ideas and I hope I 
can help.

Directory  . . . . :   /JavaUtil/JavaMail

That's where I installed the Javamail utility.

You have to edit your JavaMail.properties file.  It looks like the 
following:
email.hosttype=mail.smtp.host 
email.hostname=youremailhostnamehere 
email.localhosttype=mail.smtp.localhost 
email.localhostname=yourlocalhostnamehere 

Change your hostname to be whatever the name of your email hostname is.
Change the localhostname to be whatever the system you are running the 
apps on that are trying to send the email.

Now, if you are getting classpath errors, it could be because you aren't 
setting up your classpaths before trying to use Javamail.
I have two CL's created.  One starts the classpath.  One stops it.

STRMAIL     CLP
/*********************************************************************/
             PGM 
 
             CHGCURDIR  DIR('/JAVAUTIL/JAVAMAIL/') 
             ADDENVVAR  ENVVAR(CLASSPATH) + 
                          VALUE('.:/JAVAUTIL/JAVAMAIL/activation.jar:+ 
                          /JAVAUTIL/JAVAMAIL/imap.jar:/JAVAUTIL/JAVAM+ 
                          AIL/mail.jar:/JAVAUTIL/JAVAMAIL/mailapi.jar+ 
                          :/JAVAUTIL/JAVAMAIL/smtp.jar:/JAVAUTIL/JAVA+ 
                          MAIL/') REPLACE(*YES) 
 
             ENDPGM 

CLSMAIL     CLP
/*********************************************************************/
             PGM 
 
             RMVENVVAR  ENVVAR(CLASSPATH) 
             CHGCURDIR  DIR('/') 
 
             ENDPGM 

You might be missing the CHGCURDIR portion, cause that was troublesome for 
me when I started.  The current directory is used as the root, then it 
looks for the path from that point forward.  If you need more help, just 
shoot.


Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
Tel: 709-576-8132
Email: rpower@xxxxxxxxxx
Website: http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. - 
Sir Winston Churchill




"White Knight" <Wknight2@xxxxxxxxxxxxx> 
Sent by: java400-l-bounces@xxxxxxxxxxxx
23/06/2005 02:15 PM
Please respond to
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>


To
<java400-l@xxxxxxxxxxxx>
cc

Subject
Help with sending an Iseries email with attachments






Can anyone help me? I'd be eternally grateful :-)

 

The Director of IS was thinking the iseries is an old legacy box, and 
could
not even send email. I made the mistake of telling him the iseries is 
state
of the art and CAN send email. Unfortunately, I now have a project due in 
1
week to have some of our programs sending emails with attachments from the
iseries. 

 

We are at V5R2. I managed, with some pain, to get the TCP SMTP configured, 
I
can now use SNDDST to send email from the AS/400. But I can't use that to
send an email with a PDF and CSV attachment from the IFS. So, I googled
email and iseries, and found the Javamail page on the IBM website. 

 

First question is, is there a "blackbox" utility out there where I can 
have
a CL program call the blackbox, passing a from, to, cc email address and 
the
path to the attachment files, and it will take care of it? I tried reading
through the documentation, and it seems overly complex to do something 
that
seems fairly routine from a business perspective. I'm concerned I won't be
able to support my case of state-of-the-art if it really is that 
cumbersome
and complicated just to send an email.

 

Anyway, the documentation on the IBM website says to install the files to
the IFS. Where on the IFS?? In the root itself? In a subdirectory? Via
Iseries Navigator, I created a directory off of root called javamail and 
put
all the files there (from the javamail area on the Sun website). So,
mail.jar and activation.jar are in these directories.

 

When I run the examples given on the IBM website, I get a classpath error.
The Classpath they define in their example is
'.:/home/mail.jar:/home/activation.jar'   Since the mail.jar is in a
directory called javamail, I assumed I would substitute "home" for
"javamail" in the classpath statement. No dice. Can anyone help? If this
question is too basic for this discussion group, please contact me offline
wknight2@xxxxxxxxxxxxx

I really need some help, I've struggled with this for 2 days and my stress
level is off the charts. I tried reading the java docs on the Sun website,
but I am 100% new to Java and it is way over my head. I just assumed there
were some simple to use utilities out there for this or pre-built routines
that you just pass parameters too, or that the documentation would be more
specific. I do realize I need to buy a book on Iseries Java, but I don't
know if it will cover getting email to work or if I can learn what I need 
to
learn in time.

Again, I would REALLY be grateful if someone has a few minutes to get me 
off
and running with this.

Thanks in advance!

Ed

 

 

 

 

 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.