Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...