Sending E-Mail from a Windows Service

J

Jason E. Trout

I created at VB.NET application that sends e-mail via the
System.Web.Mail namespace. At the application level, the e-mails send
out fine.

When I created the application as a Windows service, the e-mails are
not sent out. I even made it where the service could interact with the
desktop.

Is sending e-mail from System.Web.Mail not possible via Windows
Services?

Thanks,
Jason Trout
(e-mail address removed)
 
J

Jeff Johnson [MVP: VB]

I created at VB.NET application that sends e-mail via the
System.Web.Mail namespace. At the application level, the e-mails send
out fine.

When I created the application as a Windows service, the e-mails are
not sent out. I even made it where the service could interact with the
desktop.

Is sending e-mail from System.Web.Mail not possible via Windows
Services?

What account is the service running under? The LocalSystem account cannot
talk to other machines (although I believe there are some exceptions to
this, like anonymous pipes or something) and therefore if your SMTP server
is on another machine in the network, there's your problem. If that's the
case, simply have your service run under a user account.
 
G

Greg Burns

Definately possible. I had a service that did that, but it was running
directly on my IIS server.

Greg
 
J

Jason E. Trout

Thanks for your response, but it seems that no configuration has
worked. I've installed the service as LocalSystem, LocalService,
NetworkService, and User (with administrator privileges.

It won't send out e-mail through the SMTP server. I am sending to a
remote address, but I'm also utilizing the WININET API to connect to
an ftp server, so it doesn't neccessarily seem that the service can't
access these outside network services.

Any suggestions? I appreciate it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top