|
From: Leif M. <le...@ta...> - 2005-11-07 04:35:17
|
Hakan, Could you try putting some debug information around the code trying to send the mail? I have SMTP mail features in most of the applications I write to notify administrators of problems and have never had any problems with it. I use the SUN Javamail jars. There are some restrictions about accessing windows network drives and printers when running as a service, but not about opening arbitrary sockets. Could you post the error message and stack trace you are getting? It might give me some ideas. Cheers, Leif Håkan Fransson wrote: >Hi again and thanks for the answer. First i would like to say that >it's a nice framework, easy to understand and very configurable. > >The smtp settings seems to work fine, it's through a regular >property file. E.g mail server and port is from property file and >their properties come out in the stacktrace so it's probably not that. >I've changed the user on the service to administrator as with console but >it doesn't help. I wonder if it's some security policy in windows but i >have no clue. >/Håkan > > >-----Original Message----- >From: wra...@li... >[mailto:wra...@li...] On Behalf Of Leif >Mortenson >Sent: den 6 november 2005 12:38 >To: wra...@li... >Subject: Re: [Wrapper-user] Problem with SMTP on Windows > >Hakan, >How are the SMTP settings being configured in your application? There >shouldn't be >anything about the Wrapper that would prevent you from connecting to >your mail server >if it is being configured correctly. Try adding the wrapper.debug=true >property and >verify that the command line being used to launch the JVM contains all >of the expected >values. >A common problem is problems with environment variables. Make sure that any >variables your application needs are defined system wide and not just >for your user. > >Cheers, >Leif > > >Håkan Fransson wrote: > > > >>Hi! >>I’m just started to use the wrapper to make a Windows service of my java >>application. It works perfectly when >>i run it as a consle but when i’m try to send an email with wrapper as a >>windows service i get: >> >>javax.mail.MessagingException: Could not connect to SMTP host: >>mail.steencon.se, port: 25; >> nested exception is: >> java.net.ConnectException: Connection refused: connect >> at >>com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1227) >> at >>com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:322) >> at javax.mail.Service.connect(Service.java:236) >> at javax.mail.Service.connect(Service.java:137) >> at javax.mail.Service.connect(Service.java:86) >> at javax.mail.Transport.send0(Transport.java:150) >> at javax.mail.Transport.send(Transport.java:80) >> at >>se.cesp.delivery.common.util.EmailCommunicator.send(EmailCommunicator.java: >> >> >1 > > >>88) >> at >>se.cesp.delivery.impl.OfferWebbEmail.execute(OfferWebbEmail.java:95) >> at >>se.cesp.delivery.common.util.DeliveryInvoker.run(DeliveryInvoker.java:81) >> at java.lang.Thread.run(Thread.java:534) >> >>It doesn’t matter i run the service with system account or administrator(as >>with console), it’s the same >>result. >>The java application also uses FTP and it works fine in both ways. >>Any ideas? >> >>Thanks in advance Håkan >> >>---------------------------------------------------------------- >>Håkan Fransson Phone: +46(0)90 - 786 74 93 >>Ladokenheten Fax: +46(0)90 - 786 69 91 >>Umeå University www: www.umu.se/ladokenheten >>SE - 90187 Umeå >>------------------------------------------------------------- >> >> >> |