Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting an exception while sending an mail:javax.mail.MessagingException: 554 mail server permanentl  RSS feed

 
harini veerapur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wrote a one java program for sending a mail.In that i am having a methods for sending a mail with attachment and without attachment .In jsp i am calling that method for sending an mailwithattachment.If i give a from address from gmail and all it works fine ,but if i give a within organisation mail id it will not work it will throw an following exception

javax.mail.MessagingException: 554 mail server permanently rejected message (#5.
3.0)

at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:838)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:779)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:316)
at javax.mail.Transport.send0(Transport.java:189)
at javax.mail.Transport.send(Transport.java:118)
at antares.beanClass.mail.MailObject.sendMailWithAttachment(MailObject.j
ava:720)
at org.apache.jsp.jsp.newTestMES4_jsp._jspService(newTestMES4_jsp.java:1
34)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
42)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
at java.lang.Thread.run(Thread.java:595)
javax.mail.MessagingException: 554 mail server permanently rejected message (#5.
3.0)


So what is happening or where i am going wrong ,am not getting please help me....

Thanks in advance....
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harini,

First of all, welcome to javaranch..

I guess you are not changing your smtp host, while sending mail from organisation ID...
 
harini veerapur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir,
Thanks for your reply....
I am using
Authenticator auth=null;
if(host!=null) {
auth=new PopupAuthenticator();
props.put("mail.smtp.host",host);
}
Session session1 = Session.getInstance(props, auth);
//Session session1 = Session.getDefaultInstance(props, null);
in this host will be my company mail id... Please help me....

Thanks....
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
host cannot be your company mail id, it should be the smtp server address of your company..
 
harini veerapur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
Sorry ..ya its smpt server address of our organisation...
host=mail.organisationname.com This one i used...
Thanks...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!