How to be really annoying with Pocket Outlook

Published 25 January 7 6:8 AM | William

If you've been following my coding tonight, you can probably tell what I'm up to. If you call me regularly, you probably are already familiar with this little project, aka the CuckooBot.  He's up to Version 4.0 and about to be released into the wild. Yes, this one is more functional and useful than the last but also a lot snarkier and more annoying. In fact, he's also a lot smarter. He has a lot better AI and text parsing for one thing, so he can make better decisions about whether or not I can be disturbed and if you are on the 'cool' list, he'll actually do some of your bidding. When I release the final version, I'll provide everyone with the list of commands he'll respond to.  But enough about that for now.  Part two of this project involves email.  You can shoot the CuckooBot an email with a request, like "Please send ClevelandSteamer.jpg" and if you are authorized, he'll send it.  The  authorization piece is causing me some grief but it's not like I have anything better to be doing in the middle of the night right?

Ok, so the way to send Email messages is to first create an OutlookSession object. Instantiate it and scope it as necessary.  Next, specify an EmailAccount for it.  Next create an EmailMessage and at the end, just Send() it.

Now, I've mentioned many times that things like BCC, CC, Importance and Sensitivity should be outlawed and considered as tantamount to war crimes for they are pure evil. But too many people like those features so I'll have to keep my little quixotic jihad against them going in other ways.

const String Primary = "Cuckoo1";

private

{

OutlookSession MainSession = new OutlookSession()

EmailAccount

EmailAccount MainAccount = MainSession.EmailAccounts[Primary];

EmailMessage MyMessage = new EmailMessage();

 

//One dorks set this to High.

MyMessage.Importance = Importance.Normal;

//Again, see above.

MyMessage.Sensitivity = Sensitivity.Normal;

MyMessage.Subject = "Cleveland Steamers vs. Pink Socks on Fox - 8:00 PM EDT";

MyMessage.To = new Recipient("Knights of the Cleveland Steamers", "911@clevelandsteamers.org");

MyMessage.Attachments.Add(new Attachment(@"\eviction1.jpg"));

MyMessage.BodyText = "Cleveland Steamers aren't appropriate for community sites. However I predict they'll win tonight - 9-2");

MainAccount.Send(MyMessage);

 

}

Search

This Blog

Tags

Community

Archives

News

  • William G Ryan William Ryan Bill Ryan W.G. Ryan Charles Mark Carroll Charles M Carroll
    My Blog Juice Microsoft MVP
    Bill Ryan W.G. Ryan William Ryan
    Cuckooz' MySpace Page View Bill Ryan's profile on LinkedIn
    My Profile on Twitter
    Please note that this is my personal blog and the opinions expressed are my own. Also, comment moderation is about one of the least important things in my life so please keep that in mind. I can't vouch for the authenticity of any of the posters so please don't hold me accountable. And whatever you do, don't pretend to be Noted Option Strict Off expert and AspFriend Charles Mark Carroll when you post. Doing so will lead him to become apoplectic and write absurd accusatory posts about me that are as coherent and thought out as they are factually correct. He does a stellar job proving his reputation is well deserved and he doesn't need any help from you making himself look foolish. If I have to listen to him banging his spoon off of his high chair one more time, I'm going to burst into flames so please don't make that happen!

    My other sites

    Cool Stuff

    Book Stuff

    Security

    ORM

    Data Access

    Funny Stuff

    Compact Framework Stuff

    Web Casts

    My KnowledgeBase Articles

    My MVP Profile

    Design Patterns

    Performance

    Debugging

    Remoting

    My Fellow Authors

    My Books

    LINQ

    Misc

    Speech

    Syndication

    Email Notifications