× 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.



>>So...should the email hostname be companya.com? or should it be the
mailrouter ip address?
The local host, is that my "system" name, which is the box serial number?


The email hostname should be the ip address of your mail router.
The local host, yes that's the system name.

Not sure why you are getting the java errors though.  From the looks of 
it, Javamail is fine, it looks like the program you are trying to use to 
run it is bombing.  Perhaps one of the Java gurus might have more info.
I'm just learning Java myself, I have Javamail running using RPG.  But it 
should be similar.

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 05:12 PM
Please respond to
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>


To
"'Java Programming on and around the iSeries / AS400'" 
<java400-l@xxxxxxxxxxxx>
cc

Subject
RE: Help with sending an Iseries email with attachments






Thanks to everyone who responded, that was FAST and really appreciated! 
I'm
going to try each option folks sent me as a learning process. 

I tried the BVSTOOLS, and it worked and was running in literally 10 
minutes.
I'm gonna have to pay for it out of my own pocket, but its cheap compared 
to
the frustration it just saved me!

I would still like to know why the javamail isn't working. Long term I'm
going to have to learn anyway, so this is a good place to start.

Ron: OK, I copied everything to /JavaUtil/JavaMail as you specified.

Question: 

CFGTCP option 20, then option 12, then 3. Parameter MAILROUTER is a TCP/IP
address. 
CFGTCP open 20, then 12, then 1, the SMPT name is my email address,
Ed@xxxxxxxxxxxx

So...should the email hostname be companya.com? or should it be the
mailrouter ip address?
The local host, is that my "system" name, which is the box serial number?

I set up the CLs as you have them. I ran STRMAIL.

I was getting classpath errors on the msgmultisendsample. I then added
\javautil\javamail\demo' to the end of classpath and it went away. Do you
need to specify every directory the program will need in the classpath?
Since I had \javautil\javamail in the classpath, it won't read from Demo, 
if
demo is 1 step lower in the tree? 

Then, I retried the IBM example of RUNJVA as follows:

RUNJVA CLASS(msgmultisendsample) PARM(ed@xxxxxxxxxxxx ed@xxxxxxxxxxxx) 

It brought me into a Javashell display, and I now get the following 
message:

                                                         Java Shell 
Display

 

   java.lang.NoClassDefFoundError

           at java/lang/Throwable.<init>(Throwable.java:180)

           at java/lang/Error.<init>(Error.java:37)

           at
java/lang/NoClassDefFoundError.<init>(NoClassDefFoundError.java:30)

           at java/lang/ClassLoader.defineClass(ClassLoader.java:519)

           at
java/security/SecureClassLoader.defineClass(SecureClassLoader.java:123)

           at java/net/URLClassLoader.defineClass(URLClassLoader.java:289)

           at java/net/URLClassLoader.access$300(URLClassLoader.java:62)

           at
java/net/URLClassLoader$ClassFinder.run(URLClassLoader.java:607)

           at java/net/URLClassLoader.findClass(URLClassLoader.java:198)

           at java/lang/ClassLoader.loadClass(ClassLoader.java:316)

           at 
sun/misc/Launcher$AppClassLoader.loadClass(Launcher.java:265)

           at java/lang/ClassLoader.loadClass(ClassLoader.java:272)

           at 
java/lang/ClassLoader.loadClassInternal(ClassLoader.java:332)

   Java program completed with exit code 1

 

 

 

 ===>

 

 

 

 F3=Exit   F6=Print F9=Retrieve F12=Exit

 F13=Clear F17=Top  F18=Bottom  F21=CL command entry

 

 

 

 

 


I'm sorry for the beginner questions...
Thanks again...
Ed


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx 
[mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of RPower@xxxxxxxxxx
Sent: Thursday, June 23, 2005 1:29 PM
To: Java Programming on and around the iSeries / AS400
Subject: Re: Help with sending an Iseries email with attachments

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 ...

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.