Forums > Java

Errors with a net.mail.send variant

Feb 04 2011 | 12:34 am

I’m a really big Java newbie, so please bear with me.

I’ve been trying to get it so that my Patcher can send email using any server that allows SMTP. I’m essentially adding some extra functions to some code and a patch by forums member Myer Nore (posted here:

My main frustration is getting the int in for the port. I initially did it as a string, but it seemed like that was being rejected. I’ve changed a few things around, including adding a section where the string is converted to an int, but I must have done something wrong, since it didn’t work.

I’ve also tried patching in a number box instead of a textbox, but no luck there either.

Here is the patch:

-- Pasted Max Patch, click to expand. --

And I’ve attached the java files. MXJGmail3 is the code form Myer Nore. MXJEmail3 is my attempt at tacking extra features on.

  1. MXJEmail3.class
Feb 18 2011 | 8:42 pm


I’ve been playing with this again, and I still cannot get [mxj list.replace] to change an the int for port in java. Any ideas?

Mar 30 2011 | 5:25 pm

Welp, I’ve figured out how to get ints in to Java a little easier. All I had to do was use a message like "Port 25" sent in, and it assigns itself. No list.replace required.

However, I’ve been having a new problem. Since I share my project online, I’d like to make it work anybody’s mail options. I’ve gotten it to work with Gmail and google-apps based emails. I started to test it with a hotmail account, but it isn’t working. I get an error that asks if I have "Plaintext Connection?" – from what I read, this is meaning that the TLS handshake isn’t working, or that for some reason, it doesn’t recognize the SSL connection. Here is what my java is using for authentication, I think:

//Deliver Mail Function
public void deliver() {

//Get System Properties object
Properties props = System.getProperties();

//Enable TLS
props.put( "mail.smtp.starttls.enable", "true");

// Define properties
props.put( "mail.transport.protocol", "smtps" );
props.put( "", "host" );
props.put( "mail.smtp.auth", "true" );
Mar 30 2011 | 5:49 pm

Er, also, it’s worth noting here that these are the settings for login using ssl/tls, though not every connection will use that, obviously.

Mar 30 2011 | 5:50 pm

erp doublepost

Viewing 5 posts - 1 through 5 (of 5 total)

Forums > Java