我们如何在asp.net中发送HTML模板抛出邮件? [英] How can we send html template throw mail in asp.net?

查看:69
本文介绍了我们如何在asp.net中发送HTML模板抛出邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我想要html页面模板,该模板应在smtp中用于在asp.net中发送邮件

假设我已经创建了一个包含一些图片和段落的html页面.我想更改该模板的一些文本:

例如:

亲爱的[用户名] ...

....

html页面中的此处用户名应更改为必填字段

并且该页面应通过asp.net中的smtp发送

谢谢

actually i wanted html page templates which should be used in smtp to send mail in asp.net

suppose i have created a html page with some pictures and paragraph . and i want to change the some text of that template :

For example :

Dear[Username]...

....

here in the html page username should be changed to required field

and that page should be sent via smtp in asp.net

Thanks

推荐答案

请参考以下主题:

本文向您简要介绍了使用HTML格式的SMTP发送邮件的方法,该方法采用web.config文件中的默认SMTP设置
(ASP.NET)使用SMTP在在web.config文件中使用IP设置的HTML格式 [以HTML格式发送电子邮件 [ ^ ]

本文着眼于与电子邮件相关的更高级的选项:
HTML格式的电子邮件,附件和正常处理SMTP异常 [通过HTML的ASP.NET发送电子邮件的代码段格式 [ ^ ]
以HTML和普通格式发送电子邮件文字 [ ^ ]

欲了解更多信息,请点击这里:
在.NET中找到的System.Net.Mail命名空间的完整常见问题解答 [电子邮件模板 [
Please refer following threads:

This article briefs you about sending mail using SMTP in HTML Format, which takes the default SMTP settings from web.config file
(ASP.NET)Sending mail using SMTP in HTML format using IP settings in web.config file[^]

Here''s some code that will help you construct HTML e-mail from a variety of mail objects available in ASP.
send e-mail in HTML format[^]

This article looks at the more advanced email-related options:
HTML-Formatted Emails, Attachments, and Gracefully Handling SMTP Exceptions[^]

Code snippet on sending email via ASP.NET in html format[^]
Sending Email Both in HTML and Plain Text[^]

For more have a look here:
Complete FAQ for the System.Net.Mail namespace found in .NET[^]
Email Templates[^]




您需要记住两件事
1)您需要将所有图像上传到某个图像托管服务器(那些为您的图像提供链接的服务器).该链接应放置在图像的html模板中.

2)您需要以
Hi,

You need to remember two things
1) you need to upload all your images on some image hosting server (those who provide link for your image). this link should be placed in your html template for image.

2) you need to send your email as
mailMsg.BodyFormat = MailFormat.Html

设置发送电子邮件.

并且所有其他电子邮件发送代码都应该相似.

-Amit

settings.

and all other email sending code should be similar.

-Amit


这篇关于我们如何在asp.net中发送HTML模板抛出邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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