Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Mail Exception on my website - Clueless  RSS feed

 
Mustafa Garhi
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I have a website that has a functionality to register for a course.
Like all the registration sites i too have send a confirmation mail to the user.
I m using the below code :

Properties props = System.getProperties();

props.put("mail.smtp.host", relayServerName);

Session session = Session.getInstance(props,null);
Message message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));
message.setRecipients(Message.RecipientType.TO, new
InternetAddress[] { new InternetAddress(to) });
message.setSubject(subject);
message.setContent(body, "text/plain");

Transport.send(message);


And get this in my log file :
"Sending failed; nested exception is: class javax.mail.MessagingException:
553 sorry, your mail was administratively denied. (#5.7.1) "

Please tell me the possibilities of failure.

Thanks in advance.
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'll need to contact your mail server administrator, because the problem is most likely caused outside your code. Perhaps you need to use authentication, but your admin can tell you more.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!