Hallo,
ich moechte eine Email senden mit GWT. Der Teil den ihr nun seht ist auf dem Server und ist plain Java. Von Daher sind keine GWT Kenntnisse erfolderlich.
Ich nutze hierfuer JavaMail 1.4.4
Das ist was ich habe:
exception:
excp 2
Can't send command to SMTP host (java.net.SocketException: Connection
closed by remote host)
------
Weiß jemand was ich falsch mache?
gruß
ich moechte eine Email senden mit GWT. Der Teil den ihr nun seht ist auf dem Server und ist plain Java. Von Daher sind keine GWT Kenntnisse erfolderlich.
Ich nutze hierfuer JavaMail 1.4.4
Das ist was ich habe:
Java:
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", "peter_listew...@hotmail.com");
props.put("password", "<MYPASSWORD>");
Session session = Session.getDefaultInstance(props, null);
String msgBody = "kk works";
try {
Message msg = new MimeMessage(session);
msg.setFrom(new
InternetAddress("peter_listew...@hotmail.com", "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)
------
Weiß jemand was ich falsch mache?
gruß
Zuletzt bearbeitet: