从Outlook发送邮件 [英] Send Mail From Outlook

查看:89
本文介绍了从Outlook发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过设置To,CC,BCC,正文,主题属性并从VB.net 2008添加附件来打开Outlook Express?

Is it possible to open outlook express by setting To, CC, BCC, body, subject properties and adding attachments from VB.net 2008 ?

推荐答案

否. Outlook Express没有公开执行此操作的方法.您必须使用内置的System.Net.SmtpClient类,该类不会创建将显示在Outlook的已发送邮件"文件夹中的电子邮件.
No. Outlook Express doesn''t expose a method to do this. You''d have to use the built in System.Net.SmtpClient class, which will not create an email that will show up in Outlook''s Sent Items folder.


就像您所说的那样谈论VB.NET-即代码将在服务器而不是客户端上执行,是的,这可能是可能的. Windows 7系统上没有Outlook Express.而且,如果您开始在Web服务器上打开Outlook实例,则可能会收到系统管理员的粗鲁电子邮件.

如果您想尝试在客户端上打开它-否,您不能.

如果您是说这是用VB而不是VB.NET编写的winforms,那么是的,您可能仍然做不到-在更现代的操作系统中不是,而且IIRC也没有编程API. Outlook可以,但需要安装.

您是否有任何特定原因想要这样做?直接从应用程序发送电子邮件将变得更加容易,更加灵活-这里甚至有代码: ^ ]
If we are talking about VB.NET as you seem to be - i.e. the code will execute on the server, not the client, then yes, it may be possible. Except on Windows 7 systems which don''t have Outlook express. And if you start opening Outlook instances on the web server, you are probably going to get rude emails from the system administrator.

If you mean to try and open it on the client - then no, you can''t.

If you mean this is winforms, written in VB, rather than VB.NET then yes, you probably still can''t do it - it isn''t in the more modern operating systems, and IIRC has no programming API anyway. Outlook does, but requires installation.

Is there any particular reason why you want to do that? It''s going to be a lot easier and more flexible to send the email directly from the application - there is even code here for that: Sending an Email in C# with or without attachments: generic routine.[^]


这篇关于从Outlook发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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