Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
871 views
in Technique[技术] by (71.8m points)

vbscript - Classic ASP: How to bind dynamic label name in email body

I want to bind the label value (which dynamically loads) into email body.

objMessage.TextBody=objMessage.TextBody & XXXXX & ": " & Request("Parts") & vbCrLf  

Dim PartsDesc
PartsDesc = request.querystring("partsdesc") 

 <%
    Response.Write "<label for = 'partsTxtBox' class = 'col-sm-4 col-form-label' name='"& PartsDesc &"'>" & PartsDesc & " </label>"
 %>

I want to insert the label name in XXXXX position in the email body. How can I do that?

question from:https://stackoverflow.com/questions/65840935/classic-asp-how-to-bind-dynamic-label-name-in-email-body

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Values can be bounded in same manner everywhere. Read about variables.

You already have this

Dim PartsDesc
PartsDesc = request.querystring("partsdesc") 

<%
Response.Write "<label for = 'partsTxtBox' class = 'col-sm-4 col-form-label' name='"& PartsDesc &"'>" & PartsDesc & " </label>"
%>

where PartsDesc is your variable, that has the value. If this is the required value for the email body then move the following line to be after the code where the value is assigned and use it in same manner

objMessage.TextBody=objMessage.TextBody & PartsDesc & ": " & Request("Parts") & vbCrLf

If all now works as expected, read about XSS.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...