-
I've used the Outlook object library to send email from my application but now I'm looking to take it a little further.
The mail software I'm currently using is Outlook with Microsoft Exchange. I need my app to periodically check the inbox for new mail - and to determine whether this mail is from a certain person (another application) with a specific subject. Why? Well the email good bring good news (first app worked so do something chappy) or bad (don't attempt processing cuz first App didn't work too well).
Yeah I know this could be achieved in other ways (checking file status etc) but I want to play around with other ways - an email good be forwarded automatically to support personnel's phones and such like.
If no one can help but is interested keep you're peepers to this thread as I may figure it out by tomorrow.
-
check out the MAPI Control(s)
-
Just in case peeps were interested in checking emails (using Outlook Object Lib) here's some code...
Set loOutlook = CreateObject("Outlook.Application")
Set loNameSpace = loOutlook.GetNamespace("MAPI")
Set loFolder = _ loNameSpace.GetDefaultFolderolFolderInbox).Items
Set loMailItem = loFolder.Find("[subject] = ""Test Mail""")
If loMailItem Is Nothing Then
mbMailIn = False
Else
mbMailIn = True
End If
Do While mbMailIn = True
Set loMailItem = loFolder.FindNext
'do some checking of sent/recieved day/time to only process most recent
If loMailItem Is Nothing Then
mbMailIn = False
End If
Loop
Set loMailItem = Nothing
Set loFolder = Nothing
Set loNameSpace = Nothing
Set loOutlook = Nothing
One thing I'm still trying to get around those is if the machine it's running on requires Domain/Password details to connect to the postoffice (some users do some dont)