%
'----function that removes html tags-----------
Function RemoveHTML( strText )
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
RemoveHTML = RegEx.Replace(strText, "")
End Function
'---------------------------------------------
'------defining script vars-------------------
Dim mailObj, mailCfg, myBody, fld
Dim RegEx
set RegEx = New RegExp
'--------------------------------------------
'------getting data sent by flash (filtering configuration data)------------
For Each fld in Request.Form
If Request.Form(fld) <> "" and _
fld <> "mail_to" and _
fld <> "smtp_server" and _
fld <> "smtp_port" and _
fld <> "plain_text" and _
fld <> "mail_from" and _
fld <> "mail_subject" Then
myBody = myBody & vbCRLF & " " & fld & " :
" & Trim(Request.Form(fld)) & "
"
End If
Next
'---------------------------------------------------------------------------
'----------setting conf data------------------------------------------------
On Error Resume Next
Set myMail = CreateObject("CDO.Message")
myMail.Subject = Request.Form("mail_subject")
myMail.From =Request.Form("mail_from")
myMail.To = Request.Form("mail_to")
'--------if plain text is set to true removing html---------------------------------------
if Request.Form("plain_text") = "true" then
myMail.TextBody = RemoveHTML(myBody)
'-------otherwise composing message body--------------------------------------------------
else myMail.HTMLBody = "