开发者

Outlook Flagging and make E-mail Important Using C#

开发者 https://www.devze.com 2023-04-06 22:35 出处:网络
I am currently automating emails being sent out I have everything working ok I just want to be able to flag the email and set it to important. I looked on outlook help page and they tell you most of t

I am currently automating emails being sent out I have everything working ok I just want to be able to flag the email and set it to important. I looked on outlook help page and they tell you most of this stuff and explain well, but I can't find flag email or set to important. Any help is greatly appreciated. Thanks

using Outlook = Microsoft.Office.Interop.Outlook;

 private void button13_Click(object sender, EventArgs e) //Send Email of Drawing
    {
        // Create the Outlook application by using inline initialization. 
        Outlook.Application oApp = new Outlook.Application();
        //Create the new message by using the simplest approach. 
        Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
        //Add a recipient
        Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add("email address here");
        oRecip.Resolve();
        //Set the basic properties. 
        oMsg.Subject = "Job # " + textBox9.Text + " Release (" + textBox1.Text + ")";
        oMsg.HTMLBody = "<html><body>";
        oMsg.HTMLBody += "Hello"
        //Send Message
        oMsg.Send
        //Explicitly release objects
        oRecip = null;
开发者_C百科        oMsg = null;
        oApp = null;
     }


Set the MailItem.Importance property;

http://msdn.microsoft.com/en-us/library/ff866759.aspx


MailItem.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh

should do the trick


Choose one of:

oMsg.Importance = Outlook.OlImportance.olImportanceHigh; 

oMsg.Importance = Outlook.OlImportance.olImportanceNormal;

oMsg.Importance = Outlook.OlImportance.olImportanceLow;
0

精彩评论

暂无评论...
验证码 换一张
取 消