在C#中制作HTML设计页面 [英] make html design page in c#

查看:80
本文介绍了在C#中制作HTML设计页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将样式HTML页面作为电子邮件的正文,并使用C#发送.我该怎么做?

I would like to make a style HTML page as the body of an email, and send it using C#. How can I do this?

推荐答案

这就是我要怎么做:

1.使用stringbuilder 逐行定制HTML.
2.将此stringbuilder.tostring()作为电子邮件正文发送.
3.确保将message.IsBodyHtml = true; 消息设置为MailMessage object.
This is how i would do it:

1. Use stringbuilder to tailor your HTML line by line.
2. send this stringbuilder.tostring() as the email body.
3. Make sure to set the message.IsBodyHtml = true; where message is MailMessage object.



  1. 在此处阅读有关 MHTML [ C#代码片段以从Outlook,Yahoo,HotMail,AOL和Gmail发送带有附件的电子邮件 [

  1. Read here about the MHTML[^] standard.
  2. Here''s an article on how to send email here on CP:C# Code snippet to send an Email with attachment from Outlook, Yahoo, HotMail, AOL and Gmail[^]



确保遵守提示3.来自
Rahul Rajat Singh的 [ ^ ]



Make sure to honor hint 3. from Rahul Rajat Singh''s[^] solution above.

Regards,

Manfred


将HTML页面和图像文件夹以及css文件放在一个文件夹中将其转换为rar或winzip并发送附件
Take Html Page and Image folder and css File in One folder Convert that folder to rar or winzip and send the Attachment


这篇关于在C#中制作HTML设计页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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