I am making a plugin for Outlook 2010 using VS2010 C#.
The objective of my plugin is to grab the To, CC, BC from the new email when a custom button is pressed from the ribbon and post it to an external url (which takes in a post request). Similar to how forms in html/jsp can post inputs to a different page(url).
So far, I can grab the To,CC,BC and store it in a string variable. But I don't know how to make a post to the external url.
Any help would be greatly appreciated. Thanks.
Here is my code for my function so far:
public void makePost(object Item, ref bool Cancel)
{
Outlook.MailItem myItem = Item as Outlook.MailItem;
if (myItem != null)
{
string emailTo = myItem.To;
string emailCC = myItem.CC;
string emailBCC = myItem.BCC;
if (emailTo == null && emailCC == null && emailBCC == null)
{
MessageBox.Show("There are no recipients to check.");
}
else
{
string emailAdresses = string.Concat(emailTo, "; ", emailCC, "; ", emailBCC);
//do something here to post the string(emailAddresses) to some url.
}
}
}