C# 使用C进行Outlook标记并使电子邮件变得重要#
我目前正在自动发送电子邮件我一切正常我只想能够标记电子邮件并将其设置为重要。我查看了outlook帮助页面,他们会告诉你大部分信息,并且解释得很好,但我找不到标志电子邮件或设置为重要。非常感谢您的帮助。谢谢C# 使用C进行Outlook标记并使电子邮件变得重要#,c#,winforms,outlook,C#,Winforms,Outlook,我目前正在自动发送电子邮件我一切正常我只想能够标记电子邮件并将其设置为重要。我查看了outlook帮助页面,他们会告诉你大部分信息,并且解释得很好,但我找不到标志电子邮件或设置为重要。非常感谢您的帮助。谢谢 using Outlook = Microsoft.Office.Interop.Outlook; private void button13_Click(object sender, EventArgs e) //Send Email of Drawing {
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;
oMsg = null;
oApp = null;
}
使用Outlook=Microsoft.Office.Interop.Outlook;
私有作废按钮13_单击(对象发送者,事件参数)//发送图纸的电子邮件
{
//使用内联初始化创建Outlook应用程序。
Outlook.Application oApp=新建Outlook.Application();
//使用最简单的方法创建新消息。
Outlook.MailItem oMsg=(Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
//添加收件人
Outlook.Recipient oRecip=(Outlook.Recipient)oMsg.Recipients.Add(“此处的电子邮件地址”);
oRecip.Resolve();
//设置基本属性。
oMsg.Subject=“作业”#“+textBox9.Text+”发布(“+textBox1.Text+”);
oMsg.HTMLBody=“”;
oMsg.HTMLBody+=“您好”
//发送消息
oMsg.发送
//显式释放对象
oRecip=null;
oMsg=null;
oApp=null;
}
设置MailItem.Importance属性
设置MailItem.Importance属性 选择以下选项之一:
oMsg.Importance = Outlook.OlImportance.olImportanceHigh;
oMsg.Importance = Outlook.OlImportance.olImportanceNormal;
oMsg.Importance = Outlook.OlImportance.olImportanceLow;
选择以下选项之一:
oMsg.Importance = Outlook.OlImportance.olImportanceHigh;
oMsg.Importance = Outlook.OlImportance.olImportanceNormal;
oMsg.Importance = Outlook.OlImportance.olImportanceLow;
我们应该这样做
应该这样做oMsg.FlagIcon=Outlook.OlFlagIcon.olRedFlagIcon;别担心,谢谢你,所以muchoMsg.FlagIcon=Outlook.OlFlagIcon.olRedFlagIcon;别客气,非常感谢