从Windows窗体中打开Outlook中的新电子邮件(不发送电子邮件)。 [英] Opening a new email in Outlook from a windows form (Without sending the email).

查看:115
本文介绍了从Windows窗体中打开Outlook中的新电子邮件(不发送电子邮件)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要在outlook(交换)中打开一个包含大部分字段的电子邮件

填写并附上一个文件。我不想发送正确的邮件

,因为用户必须能够编辑正文。


我怎样才能从用C#编写的Windows窗体?


我知道System.Web.Mail的内容,但是只能发送

的电子邮件。我也尝试过使用System.Diagnostics.Start(" mailto:")

方法,但这不允许附加文件。


请帮忙! :)


问候

Jan Daniel Andersen

Hi,

I need to open an email in outlook (exchange) with most of the fields
filled out and a file attached. I don''t want to send the mail right
away as the user must be able to edit the body text.

How can I accomplish this from a Windows Form written in C# ?

I know about the System.Web.Mail stuff, but that can only send the
email. I''ve also tried using the System.Diagnostics.Start("mailto:")
method, but that doesn''t allow for attaching files.

Please help! :)

Regards
Jan Daniel Andersen

推荐答案

< JA ***** @ gmail.com> schrieb im Newsbeitrag

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
<ja*****@gmail.com> schrieb im Newsbeitrag
news:11**********************@f14g2000cwb.googlegr oups.com...


我需要在outlook(交换)中打开一个电子邮件,其中填写了大部分字段并附上了文件。我不想将邮件发送到正确的位置,因为用户必须能够编辑正文。

如何从用C#编写的Windows窗体中完成此操作?

我知道System.Web.Mail的东西,但是只能发送
电子邮件。我也尝试过使用System.Diagnostics.Start(" mailto:")
方法,但这不允许附加文件。

请帮忙! :)

问候
Jan Daniel Andersen
Hi,

I need to open an email in outlook (exchange) with most of the fields
filled out and a file attached. I don''t want to send the mail right
away as the user must be able to edit the body text.

How can I accomplish this from a Windows Form written in C# ?

I know about the System.Web.Mail stuff, but that can only send the
email. I''ve also tried using the System.Diagnostics.Start("mailto:")
method, but that doesn''t allow for attaching files.

Please help! :)

Regards
Jan Daniel Andersen




你好Jan

你可以这样做:

System.Diagnostics.Process.Start(" mailto:" + mailTo +"?subject =" + subject

+"& body =

+ body);


但请确保注入的部分解码得很好:''%'' - > %25’ ; &安培; - > ''%26'';

''?'' - > %3F; ''\'' - > ''%22''newLine - > ''%0D%0A''


希望有帮助

Christof



Hi Jan
you could make it like this:
System.Diagnostics.Process.Start("mailto:" + mailTo + "?subject=" + subject
+ "&body="
+ body);

But get sure, the injected parts are well decoded: ''%'' -> ''%25''; & -> ''%26'';
''?'' -> ''%3F''; ''\'' -> ''%22'' newLine -> ''%0D%0A''

Hope that helps
Christof


我知道Mailto的东西。但那不能附加文件。我需要

获取在outlook中打开的电子邮件而不发送它但是附带一个文件

附加到它。

I know about the Mailto stuff. But that cannot attach files. I need to
get the email opened in outlook without sending it but WITH a file
attached to it.


由于附件是您要求的重要部分,因此您可能需要使用Outlook自动化。但是,你需要通过几个问题来工作

以使其运行良好,其中主要是

安全性。有关通过C#自动化Outlook的信息,请参阅
http://msdn.microsoft.com/office/und...d/default.aspx

< ja ***** @ gmail.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
Since the attachment is an important part of your requirements, you will
probably need to use Outlook Automation. However, you will need to work
through several issues to get this to work well, chief among them is
security. For information on automating Outlook through C#, see
http://msdn.microsoft.com/office/und...d/default.aspx
<ja*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...


我需要在outlook(交换)中打开一个电子邮件,其中填写了大部分字段并附上了文件。我不想将邮件发送到正确的位置,因为用户必须能够编辑正文。

如何从用C#编写的Windows窗体中完成此操作?

我知道System.Web.Mail的东西,但是只能发送
电子邮件。我也尝试过使用System.Diagnostics.Start(" mailto:")
方法,但这不允许附加文件。

请帮忙! :)

Jan Daniel Andersen
Hi,

I need to open an email in outlook (exchange) with most of the fields
filled out and a file attached. I don''t want to send the mail right
away as the user must be able to edit the body text.

How can I accomplish this from a Windows Form written in C# ?

I know about the System.Web.Mail stuff, but that can only send the
email. I''ve also tried using the System.Diagnostics.Start("mailto:")
method, but that doesn''t allow for attaching files.

Please help! :)

Regards
Jan Daniel Andersen



这篇关于从Windows窗体中打开Outlook中的新电子邮件(不发送电子邮件)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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