Hallo, ich bins wieder :/
Ich möchte gerne eine Mail per Java Applikation verschicken.
Ich habe es nun mittels Internet mit der Apache Commons Email, JavaMail API und noch einer anderen Anleitung versucht - Immer wieder die gleiche Fehlermeldung...
Ich möchte mir selber eine Mail schicken, also getinformation@web.de soll an getinformation@web.de eine Mail schicken.
Ich bin jetzt nochmal zu Apache Commons Email zurückgekommen:
Das funktioniert aber leider nicht:
Davor hatte ich noch ganz andere, denke aber mal, dass ich mich so in die richtige Richtung bewegt habe.
Ich verzweifle 'langsam'
Bitte helft mir!
Danke schonmal für eure hilfreichen Antworten!
Ich möchte gerne eine Mail per Java Applikation verschicken.
Ich habe es nun mittels Internet mit der Apache Commons Email, JavaMail API und noch einer anderen Anleitung versucht - Immer wieder die gleiche Fehlermeldung...
Ich möchte mir selber eine Mail schicken, also getinformation@web.de soll an getinformation@web.de eine Mail schicken.
Ich bin jetzt nochmal zu Apache Commons Email zurückgekommen:
Java:
package EmailSendenPackage;
import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
public class SimpleMail {
public static void main(String[] args) throws EmailException {
Email email = new SimpleEmail();
email.setHostName("smtp.web.de");
email.setSmtpPort(587);
email.setAuthenticator(new DefaultAuthenticator("username@web.de", "pw"));
// email.setSSLOnConnect(true);
email.setFrom("getinformation@web.de");
email.setSubject("TestMail");
email.setMsg("This is a test mail ... :-)");
email.addTo("getinformation@web.de");
email.send();
}
}
Code:
Exception in thread "main" org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.web.de:587
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1398)
at org.apache.commons.mail.Email.send(Email.java:1423)
at EmailSendenPackage.SimpleMail.main(SimpleMail.java:20)
Caused by: javax.mail.AuthenticationFailedException: 503 Bad sequence of commands
at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:932)
at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:843)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:748)
at javax.mail.Service.connect(Service.java:388)
at javax.mail.Service.connect(Service.java:246)
at javax.mail.Service.connect(Service.java:195)
at javax.mail.Transport.send0(Transport.java:254)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1388)
... 2 more
Davor hatte ich noch ganz andere, denke aber mal, dass ich mich so in die richtige Richtung bewegt habe.
Ich verzweifle 'langsam'
Bitte helft mir!
Danke schonmal für eure hilfreichen Antworten!