在csharp中打开Outlook [英] Open Outlook in csharp

查看:108
本文介绍了在csharp中打开Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在开发.net Framework 4.0.

根据要求,我必须通过单击电子邮件图标打开带有嵌入式图像的Outlook.

我可以使用互操作服务使用嵌入式图像打开Outlook.但是发布应用程序后,我发现它要求在服务器上安装Outlook.那么,有没有其他方法可以在不在服务器上安装Outlook的情况下打开带有嵌入式图像的Outlook?

Currently I am working on .net framework 4.0.

And as per the requirement I have to open outlook with embedded image by clicking on email icon.

I am able to open outlook with embedded image using interop services. But after publishing the application I found that it requires outlook to be installed on server. So is there any alternate way to open outlook with embedded image without installing outlook on server?

推荐答案



您可以使用标签


它需要在客户端计算机而不是服务器上的Outlook.




如果您想使用Outlook发送电子邮件,则可以简单地使用COM对象,例如像这样:

动态应用= Activator.CreateInstance(Type.GetTypeFromProgID("Outlook.Application"));
动态电子邮件= app.CreateItem(0);
email.Subject =主题";
email.Body =文字";
email.To ="email@email.com";
email.Save();
email.Attachments.Add(@"E:\ Myimage.jpg");
email.Display(true); //使用它来显示Outlook窗口
email.Send(); //使用它直接发送电子邮件
Hi,

you can use tag


it needs outlook on client computer not on server.


or

If you want to use Outlook to send your email, you could simple use the COM-Object, e.g. like this:

dynamic app = Activator.CreateInstance(Type.GetTypeFromProgID("Outlook.Application"));
dynamic email = app.CreateItem(0);
email.Subject = "Subject";
email.Body = "Text";
email.To = "email@email.com";
email.Save();
email.Attachments.Add(@"E:\Myimage.jpg");
email.Display(true); //use this to display the Outlook-window
email.Send(); //use this to send the email directly


这篇关于在csharp中打开Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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