• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaMail: Problem send mail to other host

 
Haroldo Nascimento
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I send the mails to other counts belows the server of my company. When I send the mails using JavaMail to my count in other host (haroldosp@hotmail.com) I recieve this eeror message:
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at net.upaid.mail.MailSender.execute(MailSender.java:80)
at net.upaid.mail.MailSender.main(MailSender.java:130)
What I forget. Where is the error ?
Thanks.
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears to me that the mail program isn't allowed to send to that address. You probably need to talk to the system admin to allow it, or choose another address.
 
Haroldo Nascimento
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I think stranger is that I did not submit any password and account to server Mail to try send the mail. Thus, I can send e-mail to other account of mey Mai Server, BUT dont send to other server as hotmail, yahoo.
I will have that authentic in getInstrance() of Session to it works ??
My code is here:
props = System.getProperties();
props.put("mail.smtp.host", mailHost);

// Obtem a sess�o com valor Autenticador igual null
session = Session.getInstance(props, null);
session.setDebug(true);

msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
//msg.setFrom();
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to, "111"));
//msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(cc, "22"));
msg.setSubject(subject);
collect(msg);
msg.setHeader("X-Mailer", mailer);
msg.setSentDate(new Date());
// send the thing off
Transport.send(msg);

thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!