In my Windows 8 Store app, I have a Send Email button on a page and users are able to click it and send us an email for some general enquiries.
I need to pre-load some text in the email body but I can’t seem to add line breaks to it. I tried Environment.NewLine and "\r\n". None of them works.
var mailto = new Uri("mailto:?to=james.jones@example.com&subject=Hello world&body=Hi," + Environment.NewLine + "Can you please ...");
await Windows.System.Launcher.LaunchUriAsync(mailto);
When I run it, I get “Hi,Can you please…”. The line break is omitted.
Try using
"%0d%0a"as your line break, as inThat’s a URL-encoded ASCII CR/LF sequence. That works for me for the built-in Mail app but you don’t have any particular guarantee that it would work for any arbitrary mail app that the user might install in the future.