Send HTML Content as in Outlook Mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-03-23 07:50 AM
Hi,
How to send html content as body in outlook mail.
Thank You..
------------------------------
Kummari Srikanth
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-03-23 08:17 AM
Hi Kummari Srikanth : Refer this thread : https://community.blueprism.com/discussion/format-the-body-of-outlook-email. Additionally do let me know if you face any difficulties and what exactly you want to send as part of HTML in your emails?
------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.
Regards,
Mukesh Kumar - Senior Automation Developer
NHS England, United Kingdom, GB
------------------------------
Mukesh Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-03-23 09:00 AM
Also for creating a HTML Table from a collection which is the main requirement for many- Create a custom MS Outlook HTML VBO and follow below steps:
- Initialise > Code Options > Ensure Dll and NameSpaces are listed:
- Add an action page: Send an email with HTML Table: for your reference I have kept the send email & collection count in the action itself but it should be done via process before after receiving the necessary details.
- . Add Inputs: As you can see in the above snippet : For local Variables : Style - you can add or customise as per your choice : <style type="text/css">
body, table, td {font-family: Arial, Helvetica, sans-serif !important; font-size: 10pt;}
body {font-family: Arial, sans-serif !important;};
</style> - Add 1st Code Stage with Necessary Inputs: Append HTML Tags: Code: TextAbove=TextAbove.Replace(System.Environment.NewLine,"<br />");
TextBelow=TextBelow.Replace(System.Environment.NewLine,"<br />");
TextAbove="<html><body>"+Style+TextAbove;
TextBelow=TextBelow+"</body></html>";
TAbove=TextAbove;
TBelow=TextBelow; - Check Collection Count and decide whether to create an HTML table if only collection row count is greater than 0 as in the snippet above
- Create 2nd Code stage for HTML Table with Inputs as Data Table(your collection)
- Code:
if(dtable !=null)
{
System.Text.StringBuilder strHTMLBuilder = new System.Text.StringBuilder();
strHTMLBuilder.Append("<br /><br />");strHTMLBuilder.Append("<table rules='all' bordercolor='#4d4c4d' border='1' bgcolor='#FFFFFF' cellpadding='5'>");
if (Include_Header)
{
strHTMLBuilder.Append("<tr>");
foreach (DataColumn myColumn in dtable.Columns)
{
strHTMLBuilder.Append("<td width='20%'>");
strHTMLBuilder.Append(myColumn.ColumnName);
strHTMLBuilder.Append("</td>");
}
strHTMLBuilder.Append("</tr>");
}
foreach (DataRow myRow in dtable.Rows)
{
strHTMLBuilder.Append("<tr >");
foreach (DataColumn myColumn in dtable.Columns)
{
strHTMLBuilder.Append("<td width='20%'>");
strHTMLBuilder.Append(myRow[myColumn.ColumnName].ToString());
strHTMLBuilder.Append("</td>");
}
strHTMLBuilder.Append("</tr>");
}
//Close tags.
strHTMLBuilder.Append("</table>");
strHTMLBuilder.Append("<br /><br />");
string Htmltext = strHTMLBuilder.ToString();
Htmltext1=Htmltext;
}
else
{
Htmltext1="";
} - Send the HTML Connect in the body by concatenating your output from the above code:
let me know if you face any difficulties implementing this.
------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.
Regards,
Mukesh Kumar - Senior Automation Developer
NHS England, United Kingdom, GB
------------------------------
Mukesh Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-03-23 10:23 AM
Hi Mukesh Kumar,
Refer to this thread: https://community.blueprism.com/discussion/format-the-body-of-outlook-email. This page is showing an Error. I am trying the below code.If any issue I will let you know.
------------------------------
Kummari Srikanth
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-03-23 10:32 AM
Hi Kummari Srikanth :Try this link as it will help you to understand your query more: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjuzPXAq4P-AhWRWcAKHeD-C80QFnoECAkQAQ&url=https%3A%2F%2Fcommunity.blueprism.com%2Fdiscussion%2Fformat-the-body-o...
------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.
Regards,
Mukesh Kumar - Senior Automation Developer
NHS England, United Kingdom, GB
------------------------------
Mukesh Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-03-23 02:33 PM
Hi Mukesh Kumar,
Here the main problem is to add a logo which is in the PNG format at the top right corner in the outlook mail body by using Html Code in the blue prism.
Regards & Thanks,
Srikanth
------------------------------
Kummari Srikanth
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-03-23 02:56 AM
Hi Srikanth
Can you insert this code "<div style="position: absolute; top: 0; right: 0;">
<img src="your-image.png" alt="Your Image" width="32" height="32">
</div>"
your-image.png >> Source , Your Image >> is description if required or you can remove
Based on requirement you can resize the image and mention the position as trial and error
and also attach the Image otherwise the recipient will not get
Hope this helps you
Regards
------------------------------
Lakshmi Narayana
------------------------------
