在Asp.net中通过电子邮件发送Outlook任务(C#) [英] Send Outlook Task by Email in Asp.net(C#)

查看:65
本文介绍了在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(FirstName1.LastName@Server.com);



oReceipient = oRecipients 。新增(FIRSTNAME2。 LastName@Server.com);



oReceipient = oRecipients.Add(FirstName3.LastName@Server.com);



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("FirstName1.LastName@Server.com");

oReceipient = oRecipients.Add("FirstName2. LastName@Server.com");

oReceipient = oRecipients.Add("FirstName3. LastName@Server.com");

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是一个用于创建网页的框架,它是一个位于.NET之上的库。它不能与Outlook交互,而是底层框架问题是,问题是,如果您没有告诉我们您使用的语言,我们不知道用什么语言来帮助您。



有这个这是互联网上的新事物名为谷歌。检查< a href =http://www.bing.com/search?q=outlook+task+create+VB.NET&src=IE-SearchBox&Form=IE8SRC> this< / a> ; [< a href =http://www.bing.com/search?q=outlook+task+create+VB.NET&src=IE-SearchBox&Form=IE8SRC\"target =_ blanktitle =新窗口> ^< / a>]输出。我怀疑您的服务器需要安装Outlook,以便您使用它进行迭代,然后您可以通过电子邮件发送代表该任务的文件。是的,我点击了我的搜索中的第一个点击,果然,代码需要outlook。第一篇文章假设您将任务保存到outlook中,因此您可能需要多挖一点,或使用intellisense查看导出选项的位置。
Sending an email is trivial, I assume you know this. ASP.NET is a framework for creating web pages, it is a library that sits on top of .NET. It cannot interact with Outlook, but the underlying framework can. The issue is, if you don't tell us what language you're using, we don't know what language to help you in.

There's this new thing on the interwebs, it's called google. Check <a href="http://www.bing.com/search?q=outlook+task+create+VB.NET&src=IE-SearchBox&Form=IE8SRC">this</a>[<a href="http://www.bing.com/search?q=outlook+task+create+VB.NET&src=IE-SearchBox&Form=IE8SRC" target="_blank" title="New Window">^</a>] out. I suspect your server will need to have Outlook installed, in order for you to iteract with it, then you can send the file that represents the task via email. Yes, I clicked the first hit on my search, and sure enough, the code requires outlook. That first article assumes you're saving the task into outlook, so you may need to dig a little more, or use intellisense to see where the export option is.


要继续前进,可以采取样本,也可以从以下链接中了解:

导入和导出Outlook约会(使用JavaScript) [ ^ ]
To move forward, you can take sample, understand from the below link too:
Import and Export Outlook Appointments (using JavaScript)[^]


大家好,



我在我的应用程序中使用的相同代码。并继续得到错误。错误是

由于以下错误,检索CLSID为{0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:80040154。



我认为这可能是版本的问题。我在电脑上使用Outlook Express 6.



但是我只需要完成这个版本..



请帮帮我吗?.....



感谢和问候,

btechathi
Hi All,

The Same code i am using in my application. and keep getting error. The error is
""Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154.""

I think this may be a problem with version . I am using Outlook express 6 in my computer.

But I need to done with this version only..

Please help me out?.....

Thanks & Regards,
btechathi


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆