• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

JavaMail: Problem send mail to other host

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic