PC Review


Reply
Thread Tools Rate Thread

Dissecting an incoming mail

 
 
Frode Lillerud
Guest
Posts: n/a
 
      7th Jan 2004
Hello all.

I'm writing an antispam add-in for Outlook in C#.
I'm able to trigger an event when a new message arrives, but I would like
to work with it before it reaches the Inbox.

How can I access all the headers and body info of the incoming mail?

I want to be able to move to the mail to the correct folder after checking
the contents.

Code examples (in C#) would be very helpful!
 
Reply With Quote
 
 
 
 
Frode Lillerud
Guest
Posts: n/a
 
      9th Jan 2004
A pseudo-code of what I want to do follows:


public void MethodForHandlingIncomingMail(MailItem newmail)
{
print(newmail.body);

if (body contains "spam")
{
//send mail to spamfolder
}
else
{
//send mail to inbox
}
}




How can I get ahold of the new mail as a MailItem??
 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      9th Jan 2004
Trap the ItemAdd event for the Items collection of the Inbox. It will
provide an Item for the incoming email. See
http://www.slipstick.com/dev/code/zaphtml.htm#cw for a VBA example of
an ItemAdd handler.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Frode Lillerud" <(E-Mail Removed)> wrote in message
news:Xns946B7928ACD44publiclillerudno@217.13.9.15...
> A pseudo-code of what I want to do follows:
>
>
> public void MethodForHandlingIncomingMail(MailItem newmail)
> {
> print(newmail.body);
>
> if (body contains "spam")
> {
> //send mail to spamfolder
> }
> else
> {
> //send mail to inbox
> }
> }
>
>
>
>
> How can I get ahold of the new mail as a MailItem??



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
False incoming mail notification and real incoming mail undelivere Greg Windows Vista Mail 3 25th Mar 2009 05:55 AM
Dissecting a Formula =?Utf-8?B?QWNjZXNzSGVscA==?= Microsoft Excel Misc 9 21st Sep 2007 04:48 AM
How do I retrieve incoming mail from my aol incoming saved on my p =?Utf-8?B?QW5keQ==?= Windows XP General 1 8th Dec 2006 01:43 PM
Dissecting the contents of a cell =?Utf-8?B?RG91Zw==?= Microsoft Excel Worksheet Functions 10 5th Jul 2006 08:46 PM
Dissecting managed PE file (EXE or DLL) =?Utf-8?B?cHJhZGVlcF9UUA==?= Microsoft Dot NET Framework 4 15th Jan 2006 01:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:59 PM.