javax.mail.MessagingException: 501 5.0.0 Invalid domain name
843830Jun 18 2007 — edited Jun 25 2007Hallo,
I want to send mails via sendmail.
but I get this error if I try to send.
The reason can be following :
in this company there are 2 mail servers mailext and mailint
our smtp server ist mailext but this use the mailint's certificate. (also the name is false) can this be a reason?? how can I set up that java accepts the certs with mailint too ?
these are the settings
String host="mailext.server";
String username = "username@server";
String password = "password";
String sender ="username@server";
String port = "25";
Properties props = new Properties();
props.put("mail.smtp.user", username);
props.put("mail.smtp.host", host);
props.put("mail.smtp.port", port);
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.debug", "true");
props.put("mail.smtp.socketFactory.port", port);
I have tried this code with googlemails setting and it functions.