473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reading Emails

AMP
On running the followig code, with a time that fires every 30 seconds

Dim oApp As Outlook.Application = New Outlook.Application
' String used for comparison with mail item.
' Get Mapi NameSpace.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
oNS.Logon("USER", "password", False, True)
' Get Messages collection of Inbox.
Dim oInbox As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderInbox)
Dim objFolder As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderInbox)
objFolder = objFolder.Folders.Item("Complete")
Dim osItems = CreateObject("Redemption.SafeMailItem")
Dim oItems As Outlook.Items = oInbox.Items.Restrict("[Unread]
= true")
' Get unread e-mail messages.
oItems = oItems.Restrict("[Unread] = true")
' Loop each unread message.
Dim icount As Integer
Dim i As Integer
If IsDBNull(oItems.Count) Then
icount = 0
Else
icount = oItems.Count
End If
'Try
If icount 0 Then
'reads with email and stores the results
end if
This runs ok for a while the errors
on
If IsDBNull(oItems.Count) Then

with "Cannot create ActiveX component."

Any ideas whats wrong

Oct 30 '07 #1
0 1182

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
5
by: David Costelloe | last post by:
Hi, I am having trouble with this code can't seem to load these email values any Ideas? XML File <?xml version="1.0" ?> <Sections> <FilePath> <Path>c:\temp\</Path> </FilePath>
0
by: Pavils Jurjans | last post by:
Hello, I have a third-paty application that uses text type field in MSSQL server to store data of incoming emails (full raw sources, including headers, etc.). Since the emails come in different...
3
by: Simon Harris | last post by:
Hi All, Ok, this must be a simple one, I'm trying to read a certain elements contents from an XML file. Heres what I've come up with so far, which seems to get stuick in a loop (ASPNET.EXE hogs...
1
by: Richard Browne | last post by:
I have been developing a program that takes a database of email bodies and then displays them to the user in a similar way to Outlook Express would. The problem I'm having is showing only the...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
0
by: James | last post by:
Using XML and the HttpWebRequest object, I'm easily able to authenticate an exchange user behind the scenes and retrieve a list of emails and the corresponding fields. For whatever sets of...
4
by: shmick30 | last post by:
Hi There, I am looping through and reading the body contents of a mail box with over 200 emails in it. The script is running very slow and timing out after 180 seconds, only getting through...
0
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails...
1
by: tim | last post by:
Hi, I have tried to make some code (with VB6) that will retrieve email from my personal email inbox. This works fine, but I need to read emails from a shared folder. I have goggled a lot but I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.