MF.RPA
(M.Farrell)
July 27, 2022, 11:18pm
1
Hello,
Could someone please help educate me on using variables within the Send Outlook Mail Message activity?
The output email is writing Variable1 and Variable 2 instead of the list of names.
I tried breaking up the HTML and this did not work at all “Text”+Variable1+“Text”+Variable2
IsBodyHTML is checked but I still have to quote the work for some reason. I think the quotes are preventing my variable from working.
"
TEXT:
TEXT
**Variable1**
TEXT
**Variable2**
TEXT,
TEXT
"
Yoichi
(Yoichi)
July 27, 2022, 11:39pm
2
Hi,
Can you try to use preformated text (the above </>
) or attach it as a file, due to some special character such as <
is automatically removed by this forum system.
Regards,
MF.RPA
(M.Farrell)
July 28, 2022, 12:00am
3
"<p>text</p>
<p><br></p>
<p><strong>text</strong></p>
variable1
<p><strong>text</strong></p><br>
variable2
<p><br></p>
<p>text,</p>
<p>text</p>"
Yoichi
(Yoichi)
July 28, 2022, 12:42am
4
Hi,
Can you try as the following?
"<p>text</p>"+vbcrlf+" <p><br></p>"+vbcrlf+" <p><strong>text</strong></p>"+vbcrlf+variable1+"<p><strong>text</strong></p><br>"+variable2+"<p><br></p>"+vbcrlf+"<p>text,</p>"+vbcrlf+"<p>text</p>"
OR
strBody = "<p>text</p>
<p><br></p>
<p><strong>text</strong></p>
{0}
<p><strong>text</strong></p><br>
{1}
<p><br></p>
<p>text,</p>
<p>text</p>"
Then,
String.Format(strBody,variable1,variable2)
If your variable contains HTML special character, the following might be better.
String.Format(strBody,System.Web.HttpUtility.HtmlEncode(variable1),System.Web.HttpUtility.HtmlEncode(variable2))
Regards,