Errors with a net.mail.send variant

Feb 4, 2011 at 12:34am

Errors with a net.mail.send variant

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: http://cycling74.com/forums/topic.php?id=12360#post-66651)

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.

Attachments:
  1. MXJEmail3.class
#54785
Feb 18, 2011 at 8:42pm

(bump)

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?

#197245
Mar 30, 2011 at 5:25pm

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( "mail.smtp.host", "host" );
props.put( "mail.smtp.auth", "true" );
#197246
Mar 30, 2011 at 5:49pm

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.

#197247
Mar 30, 2011 at 5:50pm

erp doublepost

#197248

You must be logged in to reply to this topic.