|
-
Oct 3rd, 2000, 10:09 AM
#1
Thread Starter
Addicted Member
I need some help to receive e-mail in a VB 6.0 application and parse the delimited text and insert it to a database. I will use outlook but do not know how to do this. I can find documentation on how to send mail but very little on how to receive it. I can handle the parseing and database part but need help with reading the message body of the E-mail message. Any help will be appreciated.
Thanks,
Joe
-
Oct 4th, 2000, 01:29 PM
#2
Addicted Member
I hope this helps. You need to reference the microsoft outlook 8.0 library in your project, and also need to be assigned as a delegate in the mailboxes you are working in. Good luck
Option Explicit
Public OlApp As outlook.Application
Public olNameSpace As outlook.NameSpace
Public olRecipient As outlook.Recipient
Private Sub cmdGetEMail_Click()
Dim olMail As outlook.MailItem
Dim strFind As String
strFind = "[Subject] = ""Subject of e-mail to read"""
Set olRecipient = olNameSpace.CreateRecipient("MailBox")
Set olMail = olNameSpace.GetSharedDefaultFolder(olRecipient, olFolderInbox).Items.Find(strFind)
' At this point, do your stuff
Set olMail = Nothing
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set OlApp = New outlook.Application
Set olNameSpace = OlApp.GetNamespace("MAPI")
olNameSpace.Logoff
olNameSpace.Logon "LogonID", "Password", False, True
End Sub
Private Sub Form_Unload(Cancel As Integer)
olNameSpace.Logoff
Set OlApp = Nothing
Set olNameSpace = Nothing
Set olRecipient = Nothing
End Sub
-
Oct 4th, 2000, 03:23 PM
#3
Thread Starter
Addicted Member
Receiving E-mail
Thanks, I will try this, I assume delegate is Username?
Thanks,
Joe
-
Oct 4th, 2000, 03:59 PM
#4
Addicted Member
Nope. Right-click on the Inbox icon in your toolbar in Outlook. Select Properties. Look on the Permissions tab. You need the logon that this program will use to be in this list, with the appropriate permissions checked, on every mailbox that it will look at.
-
Oct 5th, 2000, 11:14 AM
#5
Thread Starter
Addicted Member
receiving e-mail
Still having problems, I am using outlook 2000 (9.0 in VB).
I not see where to set permissions. I tryed the right click on the inbox but, got a different list from what you talking about. When I run the code in VB I get this message ("The message interface has returned an unknown error. If the problem persists, restart outlook.
I appreciate your help.
thanks
Joe
-
Oct 5th, 2000, 03:34 PM
#6
Thread Starter
Addicted Member
recieving E-mail
Got it working with the following code:
Set olMail = olNameSpace.GetDefaultFolder(olFolderInbox).Items.Find(strFind)
Thanks,
JOe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|