This one hangs

OK here are my properties, obviously username etc covered

properties.setProperty("protocol","smtp");

properties.setProperty("type","transport");

properties.setProperty("class","com.sun.mail.smtp.SMTPTransport");

properties.setProperty("vendor","Sun Microsystems, Inc.");

properties.setProperty("username","username");

properties.setProperty("password","password");

It loads everthing up into an

SMTPTransport transport = new SMTPTransport(session,theURLName);

System.out.println("Got here");

transport.send(message,addresses);

System.out.println("Sent");

It gets to 'got here' but not sent, it just hangs. theURLName is currently pretty arbitrary. I've assigned it to

private static final String urlName = "smtp.blueyonder.co.uk";

as that is my provider but am not sure if that is what is what I want.

[896 byte] By [burntcandlea] at [2007-11-27 7:14:41]
# 1

You're making it too hard. You don't need those first four properties

at all, and you shouldn't create an SMTPTransport object directly.

And finally, the send method is a static method and doesn't even use

the SMTPTransport object you created.

Look at the many sample programs included with JavaMail and

copy code from one of them. Better yet, get one of them to work

without modifying them at all.

See the JavaMail FAQ for debugging tips.

bshannona at 2007-7-12 19:04:55 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...