Using the NewMail Event and NewMailEx Event
Sub Application_NewMail()
If MsgBox("You have new mail. Do you want to see your Inbox?", _
vbYesNo + vbInformation, "New Mail Alert") = vbYes Then
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Display
End If
End Sub
Related examples in the same category