SMTP Configutarion error..!!!!

347 views
I am unable to send a email for the new invitee and i'm gettin error below as in log file

2015-04-03 12:34:55,027 INFO [com.ganib.notification.Notification] - Creating notification for notificationTypeName : [Ganib] Invitation
2015-04-03 12:34:55,037 INFO [com.ganib.notification.Notification] - Creating notification for delivery from: shiv prasad <shivprasad.pashupatimath@gmail.com>
2015-04-03 12:34:55,141 INFO [com.ganib.notification.Postman] - Postman: attempting to deliver email to : shivprasad.pashupatimath@gmail.com
2015-04-03 12:34:55,141 INFO [com.ganib.notification.Postman] - Postman: attempting to deliver email from : shiv prasad <shivprasad.pashupatimath@gmail.com>
2015-04-03 12:34:55,145 INFO [com.ganib.notification.Postman] - Postman.getDeliverableForNotification: Notification Subject: [Ganib] Invitation
2015-04-03 12:34:55,145 INFO [com.ganib.notification.Postman] - Postman.getDeliverableForNotification: Notification Type: [Ganib] Invitation
2015-04-03 12:34:55,145 INFO [com.ganib.notification.Postman] - Postman.getDeliverableForNotification: fromAddress: shiv prasad <shivprasad.pashupatimath@gmail.com>
2015-04-03 12:34:55,145 INFO [com.ganib.notification.Postman] - Postman.getDeliverableForNotification: toAddress: shivaaaaaaaa aaaaaaaaaa <Shivu@gmail.com>
2015-04-03 12:36:26,887 WARN [com.ganib.notification.Email] - Unable to send email.
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
    java.net.ConnectException: Connection timed out
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at com.ganib.notification.Email.send(Email.java:270)
    at com.ganib.notification.EmailDeliverable.deliver(EmailDeliverable.java:121)
    at com.ganib.notification.Postman.deliver(Postman.java:185)
    at com.ganib.notification.NotificationManager.deliverImmediately(NotificationManager.java:178)
    at com.ganib.notification.ImmediateNotification.post(ImmediateNotification.java:96)
    at com.ganib.resource.SpaceInviteNotification.post(SpaceInviteNotification.java:195)
    at com.ganib.resource.SpaceInvitationProcessor.createNotifications(SpaceInvitationProcessor.java:773)
    at com.ganib.resource.SpaceInvitationProcessor.inviteAll(SpaceInvitationProcessor.java:237)
    at com.ganib.resource.SpaceInvitationManager.commit(SpaceInvitationManager.java:510)
    at com.ganib.view.pages.directory.AddResponsibility.commitChanges(AddResponsibility.java:400)
    at com.ganib.view.pages.directory.LoadMembers.onActivate(LoadMembers.java:417)
    at com.ganib.view.pages.directory.LoadMembers.dispatchComponentEvent(LoadMembers.java)
    at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:902)
    at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081)
    at org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:56)
    at org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1943)
    at $PageRenderRequestHandler_14c7e13813c.handle($PageRenderRequestHandler_14c7e13813c.java)
    at $PageRenderRequestHandler_14c7e138127.handle($PageRenderRequestHandler_14c7e138127.java)
    at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
    at $ComponentRequestHandler_14c7e13812c.handlePageRender($ComponentRequestHandler_14c7e13812c.java)
    at org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
    at $Dispatcher_14c7e13812f.dispatch($Dispatcher_14c7e13812f.java)
    at $Dispatcher_14c7e138125.dispatch($Dispatcher_14c7e138125.java)
    at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245)
    at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
    at $RequestHandler_14c7e138126.service($RequestHandler_14c7e138126.java)
    at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778)
    at $RequestHandler_14c7e138126.service($RequestHandler_14c7e138126.java)
    at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767)
    at $RequestHandler_14c7e138126.service($RequestHandler_14c7e138126.java)
    at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
    at $RequestHandler_14c7e138126.service($RequestHandler_14c7e138126.java)
    at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
    at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81)
    at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
    at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
    at $RequestHandler_14c7e138126.service($RequestHandler_14c7e138126.java)
    at $RequestHandler_14c7e13811c.service($RequestHandler_14c7e13811c.java)
    at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197)
    at org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
    at $HttpServletRequestHandler_14c7e13811e.service($HttpServletRequestHandler_14c7e13811e.java)
    at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
    at $HttpServletRequestHandler_14c7e13811e.service($HttpServletRequestHandler_14c7e13811e.java)
    at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
    at $HttpServletRequestFilter_14c7e13811a.service($HttpServletRequestFilter_14c7e13811a.java)
    at $HttpServletRequestHandler_14c7e13811e.service($HttpServletRequestHandler_14c7e13811e.java)
    at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726)
    at $HttpServletRequestHandler_14c7e13811e.service($HttpServletRequestHandler_14c7e13811e.java)
    at $HttpServletRequestHandler_14c7e138118.service($HttpServletRequestHandler_14c7e138118.java)
    at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
    at com.ganib.hibernate.util.CustomTapestryFilter.doFilter(CustomTapestryFilter.java:134)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.ganib.security.SecurityFilter.doFilter(SecurityFilter.java:113)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.ganib.security.SessionAccessFilter.doFilter(SessionAccessFilter.java:140)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
    ... 83 more
2015-04-03 12:36:27,019 ERROR [com.ganib.notification.Postman] - Postman.deliver could not customise user and switch brand context: com.ganib.notification.DeliveryException: Error sending email

 

Confuguration of SMTP is getting failed. Please help me in this issue.

Below code i have pasted in context.xml

<Resource
name="mail/GanibSession"
auth="Container"
type="javax.mail.Session"
mail.debug="true"
mail.transport.protocol="smtp"
mail.smtp.host="smtp.gmail.com"
mail.smtp.auth="true"
mail.smtp.port="465"
mail.smtp.starttls.enable="true"
mail.smtp.user="username"
mail.password="Password"
username="username"
password="password"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
asked Apr 3, 2015 by Shivprasad (200 points)

1 Answer

0 votes
Hello,
 
Thank you for approaching us.
 
I have provided below the proper format of the SMTP Setting. Please replace them in the context.xml file.
Please provide your username and password in the code.
 
<Resource
name="mail/GanibSession"
auth="Container"
type="javax.mail.Session"
mail.debug="true"
mail.transport.protocol="smtp"
mail.smtp.host="smtp.gmail.com"
mail.smtp.auth="true"
mail.smtp.port="465"
mail.smtp.starttls.enable="true"
mail.user="enter your username here"
password="enter your password here"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
 
Also, please note that if you donot have the need of authentication, Please make 'mail.smtp.auth=false'.
 
If you are facing any other issue, Please feel free to contact us. We are happy to help you.
 
Thanks,

Jaclyn

Jaclyn N,
Ganib Support Team, Ganib Inc.
Free Signup | Free Download | Documentation
Skype ID: ganib.support
Email: support@ganib.com

 

answered Apr 3, 2015 by Jaclyn (18,310 points)
edited Apr 6, 2015 by Jaclyn
SMTP Still Same Error
Is there any other attribute / property I must define in order to enable SSL?
...