求一個去掉html代碼的asp函數

BILLSJONE 2006-09-08 10:36:08
使用<a href="mailto:">將一段包含html代碼的網頁內容調到outlook裡去,但在outlook裡顯示的不是網頁中的效果,而是直接顯示html代碼,都無法看,
不知用mailto怎麼可以在outlook裡顯示象網頁中的效果?如果不能,想求一去掉所有html代碼的asp函數?謝謝
...全文
168 9 打赏 收藏 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
BILLSJONE 2006-09-08
  • 打赏
  • 举报
回复
<a href="mailto:sdf@sd.com?body=<b>dfdsfs</b><br>sdfsdfsdf">
有这样写代码的? 我还是闪人吧...
==============================================
有這樣寫的啊,
<a href="mailto:sdf@sd.com?body=<b>dfdsfs</b><br>sdfsdfsdf">發送郵件</a>
body的內容是從數據庫出讀取的,裡面包含html代碼,就是要在調用到outlook裡時去掉body的html代碼,
flyingsnowy 2006-09-08
  • 打赏
  • 举报
回复
给我分。
BILLSJONE 2006-09-08
  • 打赏
  • 举报
回复
謝謝,兩個函數都行,等一下結帖
zhangjincheng88 2006-09-08
  • 打赏
  • 举报
回复
'--------------------------------------------------------------------
'去掉html标签,去掉换行
'--------------------------------------------------------------------
Function DropHtml(ByVal str1)
Dim regEx
Set regEx = New RegExp
regEx.Global = True
regEx.IgnoreCase = True
regEx.Pattern = "\n"
str1 = regEx.Replace(str1,"")
regEx.Pattern = "\r"
str1 = regEx.Replace(str1,"")
regEx.Pattern = "<script(.*?)>(.*?)<\/script>"
str1 = regEx.Replace(str1,"")
regEx.Pattern = "<(.+?)>"
str1 = regEx.Replace(str1,"")

DropHtml = str1
End Function

btbtd 2006-09-08
  • 打赏
  • 举报
回复
<a href="mailto:sdf@sd.com?body=<b>dfdsfs</b><br>sdfsdfsdf">
有这样写代码的? 我还是闪人吧...
btbtd 2006-09-08
  • 打赏
  • 举报
回复
要是以纯文本发送, 还得改一改

'显示纯文本内容(只提取 HTML 中的文本, 不提取标签)
function fPlainText(content)
if isNull(content) then exit function
set re1 = New regExp
re1.Global = true
re1.IgnoreCase = true

re1.Pattern = "<.*?>"
content = re1.Replace(content,"")

'if len(content)>200 then content=left(content,200)+"......"

re1.Pattern = "\r\n\s*"
content = re1.Replace(content,vbNewLine)
set re1=nothing
fPlainText=content
end function 'shawl.qiu'
BILLSJONE 2006-09-08
  • 打赏
  • 举报
回复
郵件格式是設成html格式的,直接copy網頁內容到outlook裡去就會是網頁中的效果,
但是用mailto調用outlook就會直接顯示html代碼,沒有了網頁中的效果,
如:
<a href="mailto:sdf@sd.com?body=<b>dfdsfs</b><br>sdfsdfsdf">
這樣在outlook中會直接顯示html代碼,不能夠顯示粗體和換行
btbtd 2006-09-08
  • 打赏
  • 举报
回复
对呀, 设置成 HTML 不就成了?

'显示纯文本内容(只提取 HTML 中的文本, 不提取标签)
function fPlainText(content)
if isNull(content) then exit function
set re1 = New regExp
re1.Global = true
re1.IgnoreCase = true

re1.Pattern = "<.*?>"
content = re1.Replace(content,"")

'if len(content)>200 then content=left(content,200)+"......"

re1.Pattern = "\r\n\s*"
content = re1.Replace(content,"<br/>")
set re1=nothing
fPlainText=content
end function 'shawl.qiu'
canning92 2006-09-08
  • 打赏
  • 举报
回复
不知道你说什么,mailto可以这样,怎么说也应该是发送邮件啊

如是是发送邮件,你将邮件格式设为html不就OK了吗

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧