admin管理员组

文章数量:1123602

I am using a webservice to send SMS. They need to approve the messages templates which I can replace the {{X}} whit dynamic parameters later. I have defined a template with 3 lines like this:

Your OTP is {{x}}
Thanks
example

When I try sending such message by submitting a form and write this message in the textarea it is working fine. But when I try preparing the message by codes it is not working. How should I simulate the body received from textarea by coding?

working model:

HTML:

<form action="?" method="post">
<textarea name="body"></textarea>
<input type="submit" value="submit">
</form>

Working asp Code :

message=request("body")
call sendMessage(message)

Failed code:

message="Your OTP is 123" & vbcrlf & "Thanks" & vbcrlf & "example"
call sendMessage(message)

This also failed:

message="Your OTP is 123" & chr(10) & "Thanks" & chr(10) & "example"
call sendMessage(message)

I also tried Chr(13) & Chr(10) together.

Response: {"Id":null,"Status":false,"Message":"IsNotMatchedMessageContentAndPatterns"}

本文标签: asp classicEquivalent for textarea new lines in vbscriptStack Overflow