Results 1 to 4 of 4

Thread: Does anyone know how to determine when new email arrives.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking

    Does anyone know how to determine when new email arrives? I want to be able to inform the user when new email arrives.
    212 will lead you to the truth

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    Using Outlook?

    I think you can do this using CDO (Collaboration Data Objects)...

    But..
    If it's outlook the user could change her own personal settings to broadcast a msg when a new e-mail comes in
    provided of course that Outlook is up...

    How would she be notified? Via another e-mail or via
    the company's paging system automatically?

    If it is via another e-mail, then it defeats the purpose

    If she is doing something else while OUTLOOK is not on
    for example while she is inside a VB prog...

    then one crazy way... would be to set this option referred
    to earlier... (that can be done programmatically [I guess])
    then fire Outlook within the application.. as a secondary task and minimize it..

    then if there is ny e-mail she would be notified....

    Am I way off (from this question) is it a Friday afternoon?

    All of this is to say
    We need a little bit more clarification

    Thanks


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking

    Ok, If the user recieves an email, their inbox number increase by 1. I want to be able to detect when this number changes. Much like the way the little envelope appears in the taskbar, everytime a new message arrives. I've thought about tracking the inbox number and/or determines when the little flag appears. I really don't want to be limited to OUTLOOK. Does anyone know how to acheive this? This is coding I'm using to send emails:Private Sub Form_Load()
    MAPISession1.SignOn
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    MAPISession1.SignOff
    End Sub

    Private Sub SSCommand1_Click()
    With MAPIMessages1
    .MsgIndex = -1
    .RecipDisplayName = txtAddressee1.Text
    .MsgSubject = txtSubject.Text
    .MsgNoteText = rtbMessage.Text
    .SessionID = MAPISession1.SessionID
    .Send
    End With
    txtMessageHistory.Text = DateNow
    MsgBox "Message sent successfully!", vbOKOnly, "Mail Sent"
    End Sub

    Private Sub SSCommand2_Click()
    frmContactProfile.Visible = True
    End Sub

    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Winsock1.GetData Response ' Check for incoming response *IMPORTANT*

    End Sub



    212 will lead you to the truth

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking

    I thought this may be helpful. I found the coding to detect email. Use the coding I posted previously and modify it to include the following info:

    Private Sub Form_Load()
    MAPISession1.SignOn
    MAPIMessages1.SessionID = MAPISession1.SessionID
    End Sub

    Private Sub SSCommand1_Click()

    With MAPIMessages1
    .MsgIndex = -1
    .Compose
    .RecipDisplayName = txtAddressee1.Text
    .MsgSubject = txtSubject.Text
    .MsgNoteText = rtbMessage.Text
    .ResolveName
    .SessionID = MAPISession1.SessionID
    .Send False
    End With
    txtMessageHistory.Text = DateNow
    MsgBox "Message sent successfully!", vbOKOnly, "Mail Sent"
    End Sub

    Private Sub lstInBox_DblClick()
    MAPIMessages1.MsgIndex = lstInBox.ListIndex
    MsgBox MAPIMessages1.MsgNoteText

    End Sub

    Private Sub SSCommand3_Click()
    MAPIMessages1.Fetch

    lstInBox.Clear
    For i = 0 To MAPIMessages1.MsgCount - 1
    MAPIMessages1.MsgIndex = i
    lstInBox.AddItem MAPIMessages1.MsgSubject
    Next i

    End Sub

    212 will lead you to the truth

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