如何将Word文档内容作为smtp电子邮件发送? [英] How do i send a word documents content as an smtp email?

查看:152
本文介绍了如何将Word文档内容作为smtp电子邮件发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的成员,
我的应用程序需要发送电子邮件.电子邮件的正文需要具有特定的格式.
格式和内容在MS Word文档中定义.
我可以选择文档的内容并将其复制到剪贴板.问题是如何以未更改的格式通过保持以电子邮件形式发送剪贴板中的数据.
换句话说,当电子邮件收件人查看他们的电子邮件时,他们可以在MS WORD中看到与我在屏幕上看到的相同的文档.
另外:我正在使用Visual Studio 2008,.NET4在Visual Basic中进行编程.
预先谢谢你.

加法:
Word文档包含格式,图片和颜色(非常标准)
我正在使用以下代码示例来获取内容

Dear members ,
my application requires to send emails. the email''s body needs to have a specific format.
The format and the content is defined in a MS Word document.
i can select and copy the contents of the document into the clipboard. Question is how do i send the data in the clipboard as an email BY KEEPING the format untouched.
another words, when the Emailee looks at their email, they can see the same document as i will see on my screen in MS WORD.
addition: i am programming in Visual Basic with Visual studio 2008, .NET4
thank you in advance.

Addition:
the Word document contains formatting, pictures, and colors (very standard)
i am using the following sample of code to get the contents

 .
 'open the document
 aWord.Documents.Open(STR_QUOTE_NAME)
 'select the content and copy to Clipboard
 aWord.ActiveDocument.Content.Copy()
 'noW in the subroutine dedicated to sending the email
 'i do something like this
 '....

 sub Email()
 'i will skip the declarations and the neccessary server setups
 'because i have a working subroutine
 'back to the point
  message.BodyEncoding = System.Text.Encoding.UTF8
  message.Body = ClipBoard.getText
end sub


问题是我不知道一种方法来检索剪贴板中存在的数据,以便我可以保留其
原始格式.
执行上述操作将导致收到的电子邮件格式很少.
我已经意识到,电子邮件解析平台(例如yahoo,hotmail等)将查看标头和
根据标题的Content-Type解析电子邮件:


the issue is that i don''t know of a way, to retrieving the data present in the clipboard, so that i could preserve its
original formatting.
doing the above will result in an email received which has little formatting.
what i have realized is that the email parsing platform(such as yahoo, hotmail , etc) will look at the header and
parse the email according to the header''s Content-Type:

推荐答案



我认为您可以通过smtp电子邮件上的附件执行此操作...

如果有帮助,请参阅此链接....
Hi,

I think you could do it by Attachment on you smtp email...

See this link if it could help....
System.Net.Mail FAQ




请记住投票是否有帮助...

问候,

代数




Remember to vote if it help...

Regards,

Algem


这篇关于如何将Word文档内容作为smtp电子邮件发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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