By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,471 Members | 711 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,471 IT Pros & Developers. It's quick & easy.

How to Read an Outlook Email

P: n/a
Hi!

I hate to bother you all with this, but I don't know how best to approach
a particular task.

Here's the deal:

Once a month I receive in my own inbox on my company's Outlook Exchange
email server an email from one of our vendors to which is attached a text
file (a comma-delimited data file containing the details of our monthly
billing. I then have to save that attachment to a folder in order to upload
the data into SQL Server.

My goal is to automate this process. Right now, I have to personally
download this attachment to a particular folder, and then execute a SQL
Server job that runs inserts the data into tables in our database.

What I"m hoping to do is be able to schedule the job so that it first opens
up my inbox ( or any specific inbox), looks for an email from this particular
email address, and then saves the attachment to a folder I specify. Then,
the rest of the job can run as usual.

I think a lot of companies receive data as email attachments, but I'm not
sure how they automate the process of opening up the email and then saving
those attachments to a folder.

Additionally, one company (UPS) sends us a link to our billing file rather
than attaching it. Each month I have to open the email, right mouse clidk,
and then save the linked file. Is there a way I can automate the process of
reading the email, locating the link within the text of the email, and then
saving the linked file to a selected folder?

Perhaps there's a utility or program out there, like some kind of VB.Net
control or program, that will help with this.

Any advice would be greatly appreciated. However, I've already read BOL and
I"m still cluelss. I'm absolutely certain, though, that other companies are
doing precisely what I need to be doing. I just don't know how they're doing
it.

Thanks!
Karen Grube
kl*****@yahoo.com

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Here are some links to get you started.

Read mail from outlook
http://support.microsoft.com/?scid=kb;EN-US;313795

Screen Scraping
Add the following imports to top of file.
Imports System.Text

Imports System.Net
Sample code
'STEP 1: Create a WebClient instance

Dim wc As New WebClient

'STEP 2: Call the DownloadedData method

Const strURL As String = "http://msdn.microsoft.com/"

Dim aRequestedHTML() As Byte

aRequestedHTML = wc.DownloadData(strURL)

'STEP 3: Convert the Byte array into a String

Dim objUTF8 As New UTF8Encoding

Dim strRequestedHTML As String

strRequestedHTML = objUTF8.GetString(aRequestedHTML)

'step 4 save to html file

Dim fs As New System.IO.StreamWriter("C:\MSDNWebPage.html")

fs.WriteLine(strRequestedHTML)

fs.Close()

' step 5 display data

Process.Start("C:\msdnwebpage.html")

http://www.4guysfromrolla.com/webtech/070601-1.shtml

Ken

-----------------------

"Karen Grube" <Ka********@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Hi!

I hate to bother you all with this, but I don't know how best to approach
a particular task.

Here's the deal:

Once a month I receive in my own inbox on my company's Outlook Exchange
email server an email from one of our vendors to which is attached a text
file (a comma-delimited data file containing the details of our monthly
billing. I then have to save that attachment to a folder in order to
upload
the data into SQL Server.

My goal is to automate this process. Right now, I have to personally
download this attachment to a particular folder, and then execute a SQL
Server job that runs inserts the data into tables in our database.

What I"m hoping to do is be able to schedule the job so that it first opens
up my inbox ( or any specific inbox), looks for an email from this
particular
email address, and then saves the attachment to a folder I specify. Then,
the rest of the job can run as usual.

I think a lot of companies receive data as email attachments, but I'm not
sure how they automate the process of opening up the email and then saving
those attachments to a folder.

Additionally, one company (UPS) sends us a link to our billing file rather
than attaching it. Each month I have to open the email, right mouse clidk,
and then save the linked file. Is there a way I can automate the process of
reading the email, locating the link within the text of the email, and then
saving the linked file to a selected folder?

Perhaps there's a utility or program out there, like some kind of VB.Net
control or program, that will help with this.

Any advice would be greatly appreciated. However, I've already read BOL and
I"m still cluelss. I'm absolutely certain, though, that other companies are
doing precisely what I need to be doing. I just don't know how they're
doing
it.

Thanks!
Karen Grube
kl*****@yahoo.com
Nov 21 '05 #2

P: n/a
"Karen Grube" <Ka********@discussions.microsoft.com> schrieb:
What I"m hoping to do is be able to schedule the job so that it first
opens
up my inbox ( or any specific inbox), looks for an email from this
particular
email address, and then saves the attachment to a folder I specify. Then,
the rest of the job can run as usual.


Support policy for Outlook APIs that are used in the .NET Framework
environment
<URL:http://support.microsoft.com/?scid=kb;EN-US;872895>

How to use the Microsoft Outlook Object Library to retrieve a message from
the Inbox by using Visual C# .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;310258>

HOW TO: Retrieve Unread Messages from Inbox by Using Outlook Object Model in
Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;313795>

How to retrieve specific messages using the Find method and the Restrict
method in Visual C# .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;310265>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.