A
Anthony Christianson
So far, I am able to intercept incoming mail, check to see if it meets
certain conditions, and then deleting it or letting it through.
When the item gets deleted, the little popup or the folder (depending on
which is turned on) still shows up.
What I would like to do, is intercept incoming mail, if the mail is valid,
show popup/folder. If incoming mail is not valid, delete it without having
the folder popup.
So far, I have been successful in intercepting, evaluating and deleting if
necessary, just havent figured out the popup/tray icon part.
Here is the Item received code:
private void Items_ItemAdd(object Item)
{
Outlook.MailItem mail = Item as Outlook.MailItem;
if( mail != null)
{
if( mail.Subject == "InterScan NT Alert")
{
mail.UnRead = false;
mail.Delete();
}
else if( mail.Attachments.Count > 0)
{
Outlook.Attachment attachment = mail.Attachments[1] as
Outlook.Attachment;
if( attachment != null)
{
if( attachment.FileName == "InterScan_SafeStamp.txt")
{
mail.UnRead = false;
mail.Delete();
}
}
}
}
}
certain conditions, and then deleting it or letting it through.
When the item gets deleted, the little popup or the folder (depending on
which is turned on) still shows up.
What I would like to do, is intercept incoming mail, if the mail is valid,
show popup/folder. If incoming mail is not valid, delete it without having
the folder popup.
So far, I have been successful in intercepting, evaluating and deleting if
necessary, just havent figured out the popup/tray icon part.
Here is the Item received code:
private void Items_ItemAdd(object Item)
{
Outlook.MailItem mail = Item as Outlook.MailItem;
if( mail != null)
{
if( mail.Subject == "InterScan NT Alert")
{
mail.UnRead = false;
mail.Delete();
}
else if( mail.Attachments.Count > 0)
{
Outlook.Attachment attachment = mail.Attachments[1] as
Outlook.Attachment;
if( attachment != null)
{
if( attachment.FileName == "InterScan_SafeStamp.txt")
{
mail.UnRead = false;
mail.Delete();
}
}
}
}
}