aspose file tools
The moose likes Other JSE/JEE APIs and the fly likes Getting an exception while sending an mail:javax.mail.MessagingException: 554 mail server permanentl Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "Getting an exception while sending an mail:javax.mail.MessagingException: 554 mail server permanentl" Watch "Getting an exception while sending an mail:javax.mail.MessagingException: 554 mail server permanentl" New topic
Author

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

harini veerapur
Greenhorn

Joined: Jun 29, 2010
Posts: 9
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

Joined: Apr 25, 2010
Posts: 503

Hi Harini,

First of all, welcome to javaranch..

I guess you are not changing your smtp host, while sending mail from organisation ID...


Regards, Prasad
SCJP 5 (93%)
harini veerapur
Greenhorn

Joined: Jun 29, 2010
Posts: 9
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

Joined: Apr 25, 2010
Posts: 503

host cannot be your company mail id, it should be the smtp server address of your company..
harini veerapur
Greenhorn

Joined: Jun 29, 2010
Posts: 9
Dear Sir,
Sorry ..ya its smpt server address of our organisation...
host=mail.organisationname.com This one i used...
Thanks...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting an exception while sending an mail:javax.mail.MessagingException: 554 mail server permanentl
 
Similar Threads
SQL Server 2000 connectivity error
File Download Problem
java.lang.ClassNotFoundException: javax.mail.Message
how to send mail using gmail server
Tomcat 6.0 Can't find SMTP host setting in Context.xml file