我试图在 Outlook 约会正文中显示 HTML 内容,但无法(我尝试了正文和 FTFbody 选项)。任何人请帮助我。下面是我的代码。
private void button1_Click(object sender, RibbonControlEventArgs e)
{
Outlook.Application application = Globals.ThisAddIn.Application;
Outlook.Inspector inspector = application.ActiveInspector();
Outlook.AppointmentItem AppointmentItem = inspector.CurrentItem as Outlook.AppointmentItem;
if (AppointmentItem != null)
{
if (AppointmentItem.EntryID == null)
{
string messageBody = string.Empty;
string defaultMessageBody = "Click <a href='https://www.google.com/' > here </a>";
AppointmentItem.Subject = "This text was added by using code";
AppointmentItem.Recipients.Add("testuser1@gmail.com");
AppointmentItem.Location = "INDIA";
//AppointmentItem.RTFBody = System.Text.Encoding.Default.GetBytes(defaultMessageBody);
AppointmentItem.Body = defaultMessageBody;
AppointmentItem.Save();
}
}
}
![[默认 OutLook 预约正文消息]](https://i.stack.imgur.com/41DzD.png)