• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Mail4Me

 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This is getting bored . But again, sorry for my poor English.

I need some help about using the Mail4ME package. I try to run the example of Michael Yuan (Enterprise J2ME book - the Mail application) but It doesn't work properly. I only change the properties of the JAD file:

address, hostname, pop3Host, pop3User, pop3Pass, smtpHost, smtpUser, smptPass

When I try to run the example (SendDemo MIDlet), just like it is, it doesn't work. It hangs up when trying to open the connection with the STMP Server, without throwing any Exception. It just hangs up, rare don't?
I change the code, putting the networking operations in a different Thread that the commandAction() Handler, and It works, only if I open the connection with no authentication.


try {
if (smtpAuth) {
smtpClient.open(smtpHost, 0, false,
smtpUser, smtpPass); //-> It doesn't work
} else {
smtpClient.open(smtpHost);
}
smtpClient.sendMessage(message);

I'm using the example within my LAN. With the WTK2 emulator (in one machine), and the ArgoSoft Mail Server (in another PC).
I take a look at the Mail4Me sources, and when authentication is needed it use the following code:

execute(null);
if ((user != null) && (pass != null)) {
execute("EHLO " + localhost);
execute("AUTH PLAIN " + getAuthString(user, pass));
}

When it try to call the method "execute" with the "AUTH PLAIN " + getAuthString(user, pass) parameter, the ArgoSoft Mail Server replies with the code 502 (Command not implemented).
I put the following line in the code:

System.out.println("HELP: " + execute("HELP"));

And this is the result:

HELP: 214-This is ArGoSoft Mail Server Freeware, Version 1.8 (1.8.8.3)-
Following commands are supported:
-HELO EHLO MAIL RCPT-DATA RSET NOOP AUTH-LOGIN-QUIT-

It supports the command "AUTH", but not the command "AUTH PLAIN". I think so.

I want to know if anybody use this example with another Mail Server, and get a better result.

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic