|
This is a multi-part message in MIME format.
--
I created a java-class to handle emailmessages which I want to call from
RPG.
The class is created in VAJAVA and works fine using this 'MAIN'-method for
testing.
********************************************************************
Public static void main(String[] args) {
// Open message
openSmtpMessage("user");
// Create messageHeader
setMessageTo("emailadress");
setMessageSubject("subject");
writeSmtpLine("To:", getMessageTo());
writeSmtpLine("Subject:", getMessageSubject());
// Create messageText
writeSmtpLine("Text", "dataline1");
writeSmtpLine("Text", "dataline2");
writeSmtpLine("Text", "dataline3");
// Close message
closeSmtpMessage();
}
********************************************************************
The class is added to package com.company.tools
It uses another helper class from this package too
All called methods are 'STATIC'
Now I need to change my RPG-prog to use this class from our RPG-apps.
I found some info which learned me that I needed to
'prototype' the methods I want to use, so I did as follows:
********************************************************************
'*-------------------------------------------------------------------------
'* JAVA
----
'*-------------------------------------------------------------------------
D sndSmtpObj PR O
EXTPROC(*JAVA:'com.company.tools.+
D SendSmtpMail':*CONSTRUCTOR)
D CLASS(*JAVA:'com.company.tools.+
D SendSmtpMail')
D STATIC
D openSmtpObj PR O
EXTPROC(*JAVA:'com.company.tools.+
D SendSmtpMail':'openSmtpMessage')
D CLASS(*JAVA:'com.company.tools.+
D SendSmtpMail')
D STATIC
D openParm 4A
D closeSmtpObj PR O
EXTPROC(*JAVA:'com.company.tools.+
D SendSmtpMail':'closeSmtpMessage')
D CLASS(*JAVA:'com.company.tools.+
D SendSmtpMail')
D STATIC
D writeSmtpObj PR O
EXTPROC(*JAVA:'com.company.tools.+
D SendSmtpMail':'writeSmtpLine')
D CLASS(*JAVA:'com.company.tools.+
D SendSmtpMail')
D STATIC
D writeParmType 10A
D writeParmData 132A
D setMsgToObj PR O
EXTPROC(*JAVA:'com.company.tools.+
D SendSmtpMail':'setMessageTo')
D CLASS(*JAVA:'com.company.tools.+
D SendSmtpMail')
D STATIC
D setMsgToData 132A
D setMsgSubObj PR O
EXTPROC(*JAVA:'com.company.tools.+
D
SendSmtpMail':'setMessageSubject')
D CLASS(*JAVA:'com.company.tools.+
D SendSmtpMail')
D STATIC
D setMsgSubData 132A
***********************************************************************
Finally I need to call these methods to create my emailmessage....
I found an example of 'EVAL string1 = trimstring(string)'
But in my case I just want to execute the methods without returning
anything.
Please take a look at the prototyping and give me a lead to call the methods
>From within RPG...
Btw, I tried to add the routing to the package in the classpath as follows
'ADDENVVAR' with following routing :'.:/mylib/classes/'
I hope this is correct too...
So in short:
1) Is the 'prototyping' correct
2) How do I 'execute' methods
3) Is the 'CLASSPATH'-setting correct
Patrick Goovaerts
IT/Clipper Support nv
--
[ winmail.dat of type application/ms-tnef deleted ]
--
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.