Results 1 to 3 of 3

Thread: checking e-mail

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    A caravan park in the Midlands (UK)
    Posts
    101

    Lightbulb

    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.
    Anakim

    It's a small world but I wouldn't like to paint it.

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    check out the MAPI Control(s)
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    A caravan park in the Midlands (UK)
    Posts
    101

    Cool

    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)
    Anakim

    It's a small world but I wouldn't like to paint it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width