Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending email or ftping from VB.NET windows SERVICE app

Posted on 2004-09-24
8
Medium Priority
?
219 Views
Last Modified: 2010-04-23
I have a VB.NET app that runs as a windows service.  I would like to incorporate some kind of error notification into it in case there is an exception.  I would like to either send an email directly from the application or FTP a file containing the error message to a directory on a server.

Because this application is a Windows service and runs when the machine is logged off I think there will be some difficulty sending an email using an outlook interface (no profile is loaded)

And actually, FTPing a file is preferable in this situation.  Does anyone have any code that is capable of FTPing a file to a location given a server, user ID password, file to load and location?

Thanks
0
Comment
Question by:aflat362
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 10

Expert Comment

by:prakash_prk
ID: 12143308

You have two options to download and upload files

1.Microsoft internet transfer control
2.Microsoft winsock control

http://www.dart.com/downloads/

regards
prakash
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12144169
You do not need system to be running and outlook to be open to send the mail

service can send mail as well as you will be using System.Web.Mail
http://www.codeproject.com/vb/net/SendMail.asp
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
eozz_2000 earned 1000 total points
ID: 12167136
First, make a file with all your commands for FTP, like this and save like C:\CommandFile.dat:

open
myServer
user_name
password
put
file_to_upload
local_file_path
bye

And then, use the following command from .NET:

Shell( "ftp -s:C:\CommandFile.dat", AppWinStyle.Hide, False)
0
 
LVL 3

Author Comment

by:aflat362
ID: 12172125
Duh.  Why FTP with .NET when I don't have to.  A simple FTP script will work just as well.

I can't believe I didn't think of that.

I'm not even going to launch it from my .NET app.  I'll just have an external script kick off every 15 minutes or so.

Thanks much
0
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12176436
Is great to know that this post could help you :)
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12176519
Good answer :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question