问题描述
大家好,
我正在开发WPF应用程序.我需要使用填充的基本详细信息(例如to,密件抄送,抄送,正文和附件)在撰写模式下打开默认邮件客户端.
I am developing WPF application. I need to open default mail client in compose mode with filled basic details like to,bcc,cc,body and attachment.
代码工作良好时默认邮件客户端是selected.But当我(在控制面板从默认程序)除去默认邮件客户端的代码给出.
Code works good when default mail client is selected.But When i remove default mail client(from default programs in control panel) the code gives.
MAPI mapi =新的MAPI(); ///Mapi默认类在电子邮件中添加属性
mapi.AddAttachment("C:\\ TempDocUpload \\ adFile.HTML");
mapi.AddRecipientTo("[email protected]");
mapi.AddRecipientTo("[email protected]");
mapi.SendMailPopup("testing","body text");
MAPI mapi = new MAPI(); /// Mapi default class to add property in email
mapi.AddAttachment("C:\\TempDocUpload\\adFile.HTML");
mapi.AddRecipientTo("[email protected]");
mapi.AddRecipientTo("[email protected]");
mapi.SendMailPopup("testing", "body text");
我尝试搜索google,发现"Registry.GetValue(@" HKEY_LOCAL_MACHINE \ SOFTWARE \ Clients \ Mail",",无")给予默认邮件客户端名称.我总是得到无"因此,在所有情况下无论 是否设置默认邮件客户端.
I tried to google and found that "Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail", "", "none")" gives default mail client name. I always get "NONE" as result in all case whether default mail client set or not.
我正在使用"MAPISendMail"来自"MAPI32.DLL"的方法执行
I am using "MAPISendMail" method from "MAPI32.DLL" for execution
PC配置
操作系统:Windows 10(64位)
OS : Windows 10 (64 Bit)
在此先感谢.
Thanks in Advance.
严厉
推荐答案
我使用您提供的代码,对我来说很好用,我可以获取电子邮件的默认客户端的名称.
I use code you provide, it works fine for me, I can get the name of default client of email.
Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail", "", "none")
那么您是否设置了默认的电子邮件客户端?
so do you have set thedefault Email Client?
我建议您在注册条目的 HKEY_LOCAL_MACHINE \ SOFTWARE \ Clients \ Mail 下面检查默认值.
I suggest you check the default value below HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail in register entry.
最好的问候,
鲍勃
这篇关于如何检查默认的电子邮件客户端设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!