本文介绍了在Asp.net中通过电子邮件发送Outlook任务(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



以下是我的代码。



//任务代码

Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();







Microsoft.Office.Interop.Outlook.TaskItem oTask =(Microsoft.Office.Interop.Outlook.TaskItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olTask​​Item );



oTask.Subject =这是我的任务主题;



oTask.DueDate = Convert.ToDateTime(06/29/2006);



oTask.StartDate = Convert.ToDateTime(06/28/2006);



oTask.ReminderSet = true;



oTask.ReminderTime = Convert.ToDateTime(06/28/2006 02: 40:00 PM);



oTask.Body =这是任务组;



oTask.SchedulePlus优先级=高;



oTask.Status = Microsoft.Office.Interop.Outlook.OlTask​​Status.olTask​​InProgress;



oTask.Save();







//通过电子邮件发送任务

Microsoft.Office.Interop.Outlook.Recipients oRecipients = oTask.Recipients;



Microsoft.Office.Interop.Outlook.Recipient oReceipient;



oReceipient = oRecipients.Add([email protected]);



oReceipient = oRecipients 。新增(FIRSTNAME2。 [email protected]);



oReceipient = oRecipients.Add([email protected]);



oReceipient.Type = 1;



oRecipients.ResolveAll();



oTask.Assign();



oTask.Send();



当我运行以上代码,它是用户作为emil格式,它不是任务格式。你可以帮助如何作为从应用程序发送任务的任务格式发送给用户。

Hi Guys,

below is my code.

//Code of the task
Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();



Microsoft.Office.Interop.Outlook.TaskItem oTask = (Microsoft.Office.Interop.Outlook.TaskItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olTaskItem);

oTask.Subject = "This is my task subject";

oTask.DueDate = Convert.ToDateTime("06/29/2006");

oTask.StartDate = Convert.ToDateTime("06/28/2006");

oTask.ReminderSet = true;

oTask.ReminderTime = Convert.ToDateTime("06/28/2006 02:40:00 PM");

oTask.Body = "This is the task body";

oTask.SchedulePlusPriority = "High";

oTask.Status =Microsoft.Office.Interop.Outlook.OlTaskStatus.olTaskInProgress;

oTask.Save();



//Send task via email
Microsoft.Office.Interop.Outlook.Recipients oRecipients = oTask.Recipients;

Microsoft.Office.Interop.Outlook.Recipient oReceipient;

oReceipient = oRecipients.Add("[email protected]");

oReceipient = oRecipients.Add("FirstName2. [email protected]");

oReceipient = oRecipients.Add("FirstName3. [email protected]");

oReceipient.Type = 1;

oRecipients.ResolveAll();

oTask.Assign();

oTask.Send();

when i run the above code, it is going to users as emil format, it is not going Task format. Can u plz help how to send to users as a Task format for sending the Tasks from application.

推荐答案




这篇关于在Asp.net中通过电子邮件发送Outlook任务(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 23:12