Windows 7:MsMapi / AxMsMAPI从VB应用程序发送邮件替换 [英] Windows 7: MsMapi/AxMsMAPI send mail replacement from VB application

查看:140
本文介绍了Windows 7:MsMapi / AxMsMAPI从VB应用程序发送邮件替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010中的Visual Basic开发Windows窗体应用程序,并希望最终得到一个安装程序和代码库,它将适用于Windows XP,Vista和Windows7下的win32和win64安装。 / p>

我最近将我的开发计算机从Windows XP移植到Windows 7,希望有一个更加稳定和强大的开发环境(6年前的XP笔记本电脑每天都会自动重置多次)。  ;我的新Windows 7平台很棒,但是
我发现我在Windows XP和Windows 7下使用的项目资源之间存在一些不兼容性。 


此帖子涉及电子邮件的方式带有附件的消息可以从应用程序中以编程方式生成。在我工作的Windows XP应用程序中,该软件编写并准备一封带有附件的电子邮件,供操作员使用默认电子邮件客户端发送
。 为了在Windows XP版本中完成此操作,我将Microsoft MAPI Controls 6.0(AxInterop.msmapi.dll和AxInterop.Axmsmapi.dll)作为项目资源引用。这两个DLL一起只有29kb,在我的Windows XP
开发系统上运行正常(可能是因为我的默认电子邮件客户端是Outlook或Outlook Express)。


当移植到Windows 7,Visual Studio找不到AxInterop.msmapi.dll和AxInterop.Axmsmapi.dll,我的项目无法编译。我认为这与Windows 7中Outlook Express不可用有关?


我真正想要找到的是一个通用的邮件抽象界面,它将填充发件人,收件人,正文和附件用户的默认电子邮件客户端中的属性,并让用户添加其他评论,并最终发送(或不发送)
消息。


鉴于我希望有一个win32和win64平台的代码库,任何人都可以推荐在我的应用程序中使用小尺寸和通用邮件界面而不是msmapi吗? 


我看到系统中有相似的功能.net.mail,但我没有使用它的经验。


谢谢,


- BGood

解决方案

不支持在Windows 7中使用Visual Basic 6控件,如Microsoft MAPI Controls 6.0。


默认情况下,没有邮件客户端在Windows 7上,即使你这样也意味着mehow安装了Microsoft MAPI Controls 6.0,操作系统没有支持它的邮件功能。可以通过安装MAPI客户端(如Outlook)来添加MAPI子系统。


如果您正在编写托管代码,您最好的选择是转移到System.Net.Mail,无论如何都可以使用MAPI客户端和线程模型的CPU位数。


I am developing a Windows forms application using Visual Basic in Visual Studio 2010 and hoping to end up with a single installer and code base which will work on both win32 and win64 installations under Windows XP, Vista and Windows7.

I recently ported my development computer from Windows XP to Windows 7 hoping to have a more stable and robust development environment (the 6-year-old XP Laptop was spontaneously resetting multiple time daily).  My new Windows 7 platform is great, but I am discovering some incompatibilities between the project resources I was using under Windows XP and Windows 7. 

This posting concerns how email messages with attachments can be generated programatically from within the application. In my working Windows XP application, the software composes and prepares an email message, with attachments, for the operator to send using the default email client.  To accomplish this in the Windows XP version, I referenced Microsoft MAPI Controls 6.0 (AxInterop.msmapi.dll and AxInterop.Axmsmapi.dll) as project resources. Together, these two DLLs were only 29kb and on my Windows XP development system this worked fine (probably because my default email client is Outlook or Outlook Express).

When ported to Windows 7, Visual Studio does not find AxInterop.msmapi.dll and AxInterop.Axmsmapi.dll, and my project does not compile. I assume this is related to the unavailability of Outlook Express in Windows 7?

What I would really like to find is a generalized mail abstraction interface which will populate sender, recipient, body, and attachment properties in the user's default email client, and let the user add additional comments and ultimately send (or not send) the message.

Given that I would like to have a single code base for both win32 and win64 platforms, can anyone recommend a small footprint and generalized mail interface to use instead of msmapi in my application? 

I see that similar functionality is available in system.net.mail, but I do not have any experience with using it.

Thanks,


-BGood

解决方案

Using Visual Basic 6 controls such as Microsoft MAPI Controls 6.0 in Windows 7 is not supported.

Also there is NO mail client by default on Windows 7, means even if you somehow get Microsoft MAPI Controls 6.0 installed, the OS does not have mail capability to support it. The MAPI subsystem can be added by installing an MAPI client like Outlook.

If you are writing managed code, your best choice would be moving to System.Net.Mail, which can be used regardless of the CPU bitness of the MAPI client and thread model.


这篇关于Windows 7:MsMapi / AxMsMAPI从VB应用程序发送邮件替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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