Search code examples
windows-8windows-runtimewindows-store-appswinrt-xamlwinrt-async

How to make Mail Body Text in Two lines in Windows 8 using LaunchUriAsync


Here is my Code

 var body="Hello World";
 var mailto = new Uri("mailto:[email protected]&subject=Hello&body="+body); 
 await Windows.System.Launcher.LaunchUriAsync(mailto);

I wanted to display 'Hello' in first line & 'World' in Second line.

I tried with

  var body="Hello" + "/n" + "World"

But it is not working . How can we achieve this ?


Solution

  • Try this

    var body="Hello%0D%0AWorld"
    var mailto = new Uri("mailto:[email protected]&subject=Hello&body=" + body); 
    await Windows.System.Launcher.LaunchUriAsync(mailto);
    

    You have to use %0D%0A in place of \n