i got this now:

        public void sendingnow2() throws UnsupportedEncodingException{
                String host = "smtp.live.com";
                String port = "587";

             Properties props = new Properties();

                 props.put("mail.smtp.host", host);
                 props.put("mail.smtp.port", port);
                 props.put("mail.smtp.starttls.enable", "true");
                 props.put("mail.smtp.tls", "true");
                 props.put("mail.smtp.user", "[email protected]");
                 props.put("password", "<MYPASSWORD>");

             Session session = Session.getDefaultInstance(props, null);

                String msgBody = "kk works";

                try {

                    Message msg = new MimeMessage(session);
                    msg.setFrom(new
InternetAddress("[email protected]", "lol"));
                    msg.addRecipient(Message.RecipientType.TO,
                                     new InternetAddress("piotr.listewnik@uni-
oldenburg.de", "kkk"));
                    msg.setSubject("funktioiert!");
                    msg.setText(msgBody);
                    msg.saveChanges();
                    Transport.send(msg);
                    System.out.println("k works");

                } catch (AddressException e) {
                        System.out.println("excp 1");
                } catch (MessagingException e) {
                        System.out.println("excp 2");
                        System.out.println(e.getMessage());
                }
        }


exception:

excp 2
Can't send command to SMTP host (java.net.SocketException: Connection
closed by remote host)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to