Hi Serge
I have verified the problem with a test. Please can you (or somebody else)
verify it too.
Test description and source code is below.
Thanx a lot�
Bye michi
Test:
start JAMES...
... add an user called "test"
... then compile and run JAMESMailSessionHackTest
javac -classpath .;mail.jar JAMESMailSessionHackTest.java
java -classpath .;mail.jar;activation.jar JAMESMailSessionHackTest
... then open an email client application(e.g.. outlook express) and
connect to the JAMES test user account.
... then check the inbox. An email should be arrived with the
subject "JAMESMailSessionHackTest....!!!!!!!!!!!!!!!!!!!"
OS:
Windows 2000
JAMES version:
JAMES 1.2.2
JavaMail version:
JavaMail 1.2
The source:
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
/**
* This class gets the default mail session from JAMES
* and sends an email to test@localhost.
*
* @author Michael Kaegi ([EMAIL PROTECTED])
* @version 1.0
*/
public class JAMESMailSessionHackTest {
private Session session;
public static void main(String[] args) {
JAMESMailSessionHackTest jt = new JAMESMailSessionHackTest();
jt.getMailSession();
jt.sendMail();
}
private void getMailSession() {
Properties props = new Properties();
session = Session.getDefaultInstance(props, null);
}
private void sendMail() {
try {
System.out.println("Session mail.smtp.host: " +
session.getProperty("mail.smtp.host"));
System.out.println("Session mail.user: " +
session.getProperty("mail.user"));
MimeMessage mm = new MimeMessage(session);
mm.setFrom(new
InternetAddress("[EMAIL PROTECTED]"));
mm.addRecipient(Message.RecipientType.TO, new
InternetAddress("test@localhost"));
mm.setSubject("JAMESMailSessionHackTest....!!!!!!!!!!!!!!!!!!!");
mm.setText("Suprise.");
Transport.send(mm);
} catch(Exception e) {
System.out.println("Exception: ");
System.out.println(e);
e.printStackTrace();
}
}
}
_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>