4

I want to share some text using mail client on windows 8, in which I want to display new lines. It displays it correctly in notepad on using \r\n but doesn't work with the SetText function in DataTransferManager.

Simon P Stevens
  • 27,303
  • 5
  • 81
  • 107
Milan Aggarwal
  • 5,104
  • 3
  • 25
  • 54

1 Answers1

2

The key is to set text in HTML and not send it as string.

Suppose the text you want to share is in string textToShare; Note that you will be sending a string in HTML, so you need to replace all new line characters with <br/>

instead of

theRequest.Data.SetText(textToShare);

use

theRequest.Data.SetHtmlFormat(HtmlFormatHelper.CreateHtmlFormat(textToShare));
eldarerathis
  • 35,455
  • 10
  • 90
  • 93
arsanyf
  • 1,573
  • 1
  • 14
  • 14