The Rookie Rides Again - Error using the Mail Plugin

Hi,

Well, for today’s adventure, I’m attempting to set up and use the mail plugin. And, after a few hours of aborted attempts, am finally making some progress, where progress is measured as “getting a different error message”. So, In trying to send an email message, I’m getting the following error in the server log…

javax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketException: Connection reset

Here is a snippet from the code I’m using…

var properties = new Array();
properties[0] = ‘mail.smtp.host=smtp.att.yahoo.com’;
properties[1] = ‘mail.smtp.port=465’;
properties[2] = ‘mail.smtp.auth=true’;
properties[3] = ‘mail.smtp.username=xxuseridxx’;
properties[4] = ‘mail.smtp.password=xxpasswordxx’;

properties[5] = ‘mail.smtp.starttls.enable=true’;
properties[6] = ‘mail.smtp.ssl.enable=true’;
var success = plugins.mail.sendMail(‘ron.gafron@workingartist.com’,‘ron.gafron@workingartist.com’,‘test email’,‘this is a test’,null,null,null,properties);
if (!success)
{
plugins.dialogs.showWarningDialog(‘Alert’,plugins.mail.getLastSendMailExceptionMsg(),‘OK’);
}

The warning dialog is showing the “exception reading response” message. Not sure exactly what to make of this. I’m thinking of using WireShark to look at the actual packets, but I’m wondering if a connection reset on the server could be some kind of timeout.

As always, any help would be appreciated.

Ron

Hi again,

Well, through a series of gyrations setting port numbers and a couple of other security settings, I was able to get mail plugin to, well, not generate an exception that would be caught by getLastSendMailExceptionMsg. The email did arrive here, but I’m getting this message in the server log…

java.lang.NullPointerException

Not sure what that means in the context of the mail plugin. Since I was just running a test, it could be that I just haven’t surrounded the mail plugin function with appropriate code.

Any thoughts? At least it’s getting better :-)

Ron

Ron,

What is the stack trace shown with the nullpointer exception?

Rob

Hi Rob,

Sorry for not getting back sooner on this. I ended changing some things in the properties in order to use a different mail server, and the problem went away. I apologize for not running a more controlled test in order to get the information for you. Time permitting, I’ll go back and try to recreate it. For now, tho, I’m good.

Ron