How to be really annoying with Pocket Outlook
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);
}