Solved

Sending email or ftping from VB.NET windows SERVICE app

Posted on 2004-09-24
8
216 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 250 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 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