Sending failed;
nested exception is:
class javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 553 sorry, that domain isn’t allowed to be relayed thru this MTA (#5.7.1)
Oque será este erro?
aqui esta meu codigo…
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setDisposition("INLINE");
FileDataSource fds = new FileDataSource(arquivo);
mbp1.setDataHandler(new DataHandler(fds));
mbp1.setFileName(fds.getName());
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
Properties mailProps = new Properties();
mailProps.put("mail.smtp.host", mailServer);
Autenticacao auth = new Autenticacao(ls_usr, ls_pass);
if(ls_NeedAuth.equals("0")){
mailProps.put("mail.smtp.auth", "false);
} else if(ls_NeedAuth.equals("1")){
mailProps.put("mail.smtp.auth", "true");
mailProps.put("mail.user", auth.ls_Usuario);
mailProps.put("mail.from", from);
mailProps.put("mail.to", to);
}
Session mailSession = Session.getDefaultInstance(mailProps, auth);
mailSession.setDebug(false);
MimeMessage message = new MimeMessage(mailSession);
// InternetAddress destinatario = new InternetAddress(to);
try{
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setFrom(new InternetAddress(from));
message.setSubject(subject);
// message.setContent(mp);
Transport.send(message);
sent = true;
}
catch (SendFailedException ex){
javax.mail.Address[] invalids = ex.getInvalidAddresses();
setListaInvalidos(invalids);
System.out.println( ex.getMessage() );
}
catch (Exception ex){
}[/img]