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



If you look in the IFS of the 400, it should be in the directory where you 
installed JavaMail.  Here's a screenshot of our setup:
                            Work with Object Links  
  
Directory  . . . . :   /JavaUtil/JavaMail  
  
Type options, press Enter.  
  2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes 
 
  11=Change current directory ...  
  
Opt   Object link            Type     Attribute    Text  
      stacktrace.log         STMF  
      JavaMail.class         STMF  
      JavaMail.java          STMF  
      JavaMail.propertie >   STMF  
      JavaMailwithAttach >   STMF  
      JavaMailwithAttach >   STMF  
      MailTest.class         STMF  
      MailTest.java          STMF  
      TestiSeries.class      STMF  
 More...
Parameters or command  
===>  
F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F12=Cancel   F17=Position 
to 
F22=Display entire field           F23=More options  

I have it installed in the root directory/JavaUtil/JavaMail directory 
within the IFS.
I find it easiest to see this stuff using iSeries Navigator.

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




Shane_Cessna@xxxxxxx 
Sent by: java400-l-bounces@xxxxxxxxxxxx
27/06/2005 03:38 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






Ron,

I'm trying to set up JavaMail on my 400 and can't seem to find the 
JavaMail.properities file you're referring to...where might I find this?

Shane Cessna 
iSeries Programmer
iSeries WAS Administrator
North American Lighting, Inc.
(618) 662-4483 x2776
shane_cessna@xxxxxxx 



RPower@xxxxxxxxxx 
Sent by: java400-l-bounces@xxxxxxxxxxxx
06/23/2005 09:59 AM
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






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.