如何调用用户(非Outlook)的.NET程序的电子邮件应用程序 [英] how to invoke user's (non-outlook) email application from .NET program

查看:168
本文介绍了如何调用用户(非Outlook)的.NET程序的电子邮件应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的C#应用​​程序需要通过电子邮件从用户的机器问题报告给支持技术。没有共同的SMTP服务器可用,所以我不认为我可以使用System.Net.Mail;而不是消息必须使用用户自己的电子邮件程序和客户发送。我可以使用办公自动化启动Outlook和撰写邮件。但是,如果用户没有使用什么前景?是否有支持多个电子邮件客户端的任何更通用的机制?或者是有一个知道如何检测和调用各种客户端库?

编辑:因为这提交问题报告,我需要包括附件或(在最坏的情况)长的消息体...

解决方案

 的Process.Start(电子邮件地址:hurr@durr.com);
 

借助的Process.Start 方法手关闭的操作系统执行一个特定指令的责任。 Windows将识别的mailto 方案和劳克相应的邮件客户端。这是使用默认程序的配置。

My C# application needs to email problem reports from the user's machine to a support tech. There is no common SMTP server available, so I don't think I can use System.Net.Mail; instead the message must be sent using the user's own email program and account. I could use office automation to launch outlook and compose a message. But what if the user is not using outlook? Is there any more general mechanism that is supported by multiple email clients? Or is there a library that knows how to detect and invoke various clients?

EDIT: as this for submitting problem reports, I need to include attachments or (at worst) a long message body...

解决方案

Process.Start("mailto:hurr@durr.com");

The Process.Start method hands off to the operating system the responsibility of executing a particular instruction. Windows will recognize the mailto scheme and lauch the appropriate mail client. This is configured using Default Programs.

这篇关于如何调用用户(非Outlook)的.NET程序的电子邮件应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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