the misidentification was missing.
the following works properly.
public void sendingnow() throws UnsupportedEncodingException{
Properties props = System.getProperties();
props.put("mail.smtp.host", "smtp.live.com");
props.put("mail.smtp.port", "587");
props.put("mail.transport.protocol","smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.tls", "true");
props.put("mail.smtp.user", "[email protected]");
props.put("mail.password", "<MYPASSWORD>");
props.put("mail.debug","true");
javax.mail.Authenticator auth = null;
auth = new javax.mail.Authenticator(){
@Override
public PasswordAuthentication
getPasswordAuthentication()
{
return new
PasswordAuthentication("[email protected]","<MYPASSWORD>");
}
};
Session session = Session.getDefaultInstance(props, auth);
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());
}
}
--
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.