I am using “Sharing” to send text (string) by email.
the data I am sharing is created like this:
string data = "Log Data\n" + "========\n";
data += "Log Type : " + log.LogType.ToString() + "\n";
data += "Date/Time: " + log.TimeStamp.ToString( "MM/dd/yy - HH:mm:ss" ) + "\n";
data += "Result: " + log.Result.ToString() + "\n";
data += "Value1: " + log.Value1 + " Value2: " + log.Value2 + "\n";
data += "Note: " + log.Note + "\n\n";
the data is prepared and sent in an email. However the “\n” is not interpreted correctly neither before I send (by the Windows 8 mail program) or the receiving side GMail.
The data presented on the send side looks like this:
Log Data ======== Log Type : ToDo Date/Time: 06/05/12 - 08:00:00 Result: Normal Value1: 170 Value2: 0 Note: note 1
The ShareTextHandler is like this:
DataRequest request = e.Request;
request.Data.Properties.Title = "Share Data: ";
request.Data.Properties.Description = "Send Data to an email address";
request.Data.SetText( data );
Was the “\n” changed in Windows 8? or the SetText does something to remove it?
EitanB
UPdate….
Hi,
Tried to do it with HTML:
Tried some test data with HTML like this:
private string PrepareShareData()
{
string CR = System.Environment.NewLine;
string data = string.Empty;
data += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Final//EN\">" + CR;
data += "<html>" + CR;
data += "<body>" + CR;
data += "<p>" + CR;
data += "Log Data" + "<br/>" + CR;
data += "========" + "<br/>" + CR;
data += "Line 1" + "<br/>" + CR;
data += "Line 2" + "<br/>" + CR;
data += "<p>" + CR;
data += "</body>" + CR;
data += "</html>" + CR;
return data;
}
Did not work…
Tried also:
private string PrepareShareData()
{
string CR = System.Environment.NewLine;
string data = string.Empty;
data += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Final//EN\">";
data += "<html>";
data += "<body>";
data += "<p>";
data += "Log Data" + "<br/>";
data += "========" + "<br/>";
data += "Line 1" + "<br/>";
data += "Line 2" + "<br/>";
data += "<p>";
data += "</body>";
data += "</html>";
return data;
}
did not work either….
I did create a .HTML file with the notepad that worked fine:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
<html>
<body>
<p>
Log Data<br/>
========<br/>
Line 1<br/>
Line 2<br/>
</p>
</body>
</html>
Is there a mail problem with HTML too or my HTML is wrong?
Thanks,
EitanB
Used:
Where data is:
too much work to go around Microsoft problem….
EitanB