如何保管邮件正文 [英] how can custmize mail body

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

问题描述

亲爱的所有人
我正在邮寄邮件项目
现在我想使用吸引人的邮件正文
我该如何格式化任何正文的邮件正文给我示例?

dear to all
i m maiking mail project
now i m want to use attractive mail body
how can i formatting mail body any body give me example

推荐答案

答案取决于很多因素,包括您的电子邮件客户端.

我做了什么:

我得到了一个简单的HTML编辑器,并为我的代码创建了模板,其中包括添加公司徽标,使徽标看起来更加正式.在我想获取动态数据的区域中,我将其以诸如%username%之类的格式放置.这需要一些思考,因为如果您有多个独立动态数据区域,则必须能够在代码中创建独立变量.接下来,我从视觉切换到HTML原始视图,将其复制并粘贴到项目中的文本资源中.

最后,我获取了资源,并在其中替换了
The answer depends upon many things including your email client.

What I did:

I got a simple HTML editor and created the template for my code including adding the company logo which gave it a more official-looking appearance. In areas where I wanted to have dynamic data I put it in a format such as %username%. It takes a bit of thinking because if you have several areas of independent dynamic data, you have to be able to create independent variables in your code. Next I flip from visual to HTML raw view, copy it and paste it into a text resource in my project.

Finally I grab the resource and I do replaces in it
String.Replace("%username%", user.ToString());



最后一部分是您依赖邮件客户端的地方.您必须深入研究API文档,以了解如何指定要发送的HTML正文.剩下的就是小菜一碟.只需按照与以往相同的格式设置邮件对象.



The last part is where you get dependent on the mail client. You have to dig into the API docs to find out how to specify you are sending an HTML body. The rest is a piece of cake. Just format your mail object the same as you always have.


请参阅以下链接 http://www.4guysfromrolla.com/articles/080206-1.aspx [ ^ ]
http://www.4guysfromrolla.com/articles/072606-1.aspx#postadlink [ ^ ]
see these links http://www.4guysfromrolla.com/articles/080206-1.aspx[^]
http://www.4guysfromrolla.com/articles/072606-1.aspx#postadlink[^]


看这些文章

电子邮件模板:处理模板文件的通用解决方案 [电子邮件模板 [ MailMergeLib-.NET邮件客户端库 [
Look at these articles

Email Templates: A generic solution to handle template files[^]
Email Templates[^]
MailMergeLib - A .NET Mail Client Library[^]


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

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