Last post Jun 06, 2018 04:06 PM by bruce (sqlwork.com)
Jun 05, 2018 07:25 PM|smilingLily|LINK
Emailbody = document.getElementById('<%=GVExternalUsers.ClientID%>').outerHTML;
var parser = new DOMParser;
var dom = parser.parseFromString(
'<!doctype html><body>' + Emailbody,
decodedString = dom.body.textContent;
window.location.href = "mailto:?body=" + decodedString + "&subject=" + Emailsubject;
I am trying to load grid view with inside outlook using jquery. When I use the above code it is working but it is loading just text,
I need to keep the gridview styling as well. how can I do that??
Jun 05, 2018 07:39 PM|smilingLily|LINK
I still need help in loading the grid with correct styling because all I see is text inside the mail.
Jun 06, 2018 12:12 AM|bruce (sqlwork.com)|LINK
Jun 06, 2018 08:28 AM|Brando ZWZ|LINK
According to the RFC 2368 aticle's section2, you could find the body field is supposed to be in text/plain format, so you couldn't send the email body as html body.
If you want to send the html body as E-mail body, I suggest you could try to send the e-mail in code-behind.
For exmaple: you could use some library(e.g Spire.Email) to send the E-mail.
More details about how to send the E-mail in code-behind with html body, you could refer to below codes:
Jun 06, 2018 02:29 PM|smilingLily|LINK
I implemented it in the code behind 1st. But we are not sending the email just opening the grid in outlook and then its upto end user to send the email or not.
The server I have the web application hosted does not have outlook installed. so I needed to implement this functionality on the client side.
Jun 06, 2018 04:06 PM|bruce (sqlwork.com)|LINK
all the mailto url body parameters in the way of markup is spaces (%20) and line breaks (%0A). you might get a table look using tabs and spaces, but you can not insert html tags.
if this s an internal app, you could use EWS or the office graph api to create a draft document with markup.