邮件格式化字符串获取Html标记 [英] Mail formated string getting Html tags

查看:91
本文介绍了邮件格式化字符串获取Html标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



可能是主题名称不可理解,但我在这里解释我想要的确切。



我将文本从CK编辑器存储到数据库,如下面的代码在vb.net中: -



 strbody = CKEditor1.Text 
temp.TempEbody = Server.HtmlEncode(strbody)





它存储为:



 <   p  >  
测试Html encodingTesting Htm < / p >
< p >
l encodingTesting Html encodingTesting < / p >
< p >
Html encodingTesting Html encodingTesting H < / p >
< p >
tml encodingTesting Html encodingTesting Html < / p >
< p >
encodingTesting Html encodingTesting Ht < / p >
< p < span class =code-keyword>>
ml encodingTesting Htm l编码< / p >





当我拿到相同的文字并希望通过邮件发送时,它会发送带有html标签。



有人能建议解决方案吗?



谢谢

解决方案

< blockquote>您可以从编辑器中获取纯文本,也可以设置

 IsBodyHtml =  true  



用于您的邮件定义。


解决了我自己



Dim strYourHTML作为字符串

strYourHTML =

你的字符串



Dim strDecodedHTML As String

strDecodedHTML = Server.HtmlDecode(strYourHTML )





谢谢


Hi All,

May be the topic name is not understandable, but I am explaining here what i want exactly.

I am storing the text from CK editor to database as below code in vb.net :-

strbody = CKEditor1.Text
temp.TempEbody = Server.HtmlEncode(strbody) 



it is storing as :

<p>
Testing Html encodingTesting Htm</p>
<p>
l encodingTesting Html encodingTesting</p>
<p>
Html encodingTesting Html encodingTesting H</p>
<p>
tml encodingTesting Html encodingTesting Html</p>
<p>
encodingTesting Html encodingTesting Ht</p>
<p>
ml encodingTesting Html encoding</p>



and when I am fetching the same text and want to send over the mail it is sending with the html tags.

Can anyone suggest the solution?

Thanks

解决方案

Either you can fetch plain text from the editor or you can set

IsBodyHtml = true


for your mail definition.


Solved my self

Dim strYourHTML As String
strYourHTML = "

your string

"
Dim strDecodedHTML As String
strDecodedHTML = Server.HtmlDecode(strYourHTML)


Thanks


这篇关于邮件格式化字符串获取Html标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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