I have caught up with an issue.
I have tried the below listed code to send mail. The issue is
eg: 1) from :abc@sam.com To :
acd@sam.com , it works fine.
2) from :abc@sam.com To :
acd@don.com, it leads to an issue.
issue:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for
sanjeev.janardhanan@gmail.com
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1607)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:887)
at javax.mail.Transport.send0(Transport.java:191)
at javax.mail.Transport.send(Transport.java:142)
at com.servion.FileUpload.doPost(FileUpload.java:235)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for
sanjeev.janardhanan@gmail.com
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1458)
Code: