且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Windows窗体中打开Outlook中的新电子邮件(不发送电子邮件)。

更新时间:2023-11-30 08:25:46

< 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’ ; &安培; - &GT; ''%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