locked
Launching email app with pre-fill message

    Question

  • Please look at Windows 8 Email app, while compose new message, from the appbar when you click button Open Window (Open message in a separate window), app will open another email app with prefill html message and user can continue write/edit their message.

    Can anyone help me with a winjs, javascript code to launch email app with pre-fill message like that (I'm not talking about Share html text via the charm)

    Thank you

    Thursday, November 14, 2013 6:00 PM

Answers

  • Hi Sushil,

    "mailto" is a standard protocol supported by many (probably most) email applications, including the Windows Mail client. Using a custom protocol would be a bad idea since it would require the user have a specific email client. Using "mailto" will allow users to choose their own clients.

    As you suggest, the share charm may be an even better choice than locking the user into email. In general I'd recommend using the share charm for general sharing or connecting to a dedicated web service for targeted feedback scenarios.

    The share charm will allow the user to choose how and where to share the data.

    A web service will allow the app to send data to a specific location and doesn't rely on the user having an email client set up and pushing send on the default options in the mailto: link.

    Most email scenarios would be better off with one of these rather than taking a side trip through the email client.

    --Rob

    Tuesday, November 19, 2013 4:57 AM
    Owner

All replies

  • You can navigate to a mailto: URI.

    There isn't any direct way for Windows Store apps to launch or communicate with specific applications.

    The Email app (I assume you mean Windows 8.1, not Windows 8) creates another view within the same app. It doesn't open another email app. See the Multiple Views Sample for more details.

    --Rob

    Thursday, November 14, 2013 6:05 PM
    Owner
  • Thank you. I'm thinking about using this code below to open email app with pre-fill message but mail app doesn't accept html format, do you know how to fix?

    var mailto = new Windows.Foundation.Uri("mailto:?to=email@email.com&subject=test&body=<b>Hello</b>. How are you?");
    Windows.System.Launcher.launchUriAsync(mailto);

    Thursday, November 14, 2013 9:59 PM
  • You cannot rely on the mailto: app understanding html. Even if the mail app did, there is no guarantee that the user has assigned mailto: to the mail app.

    --Rob

    Thursday, November 14, 2013 10:11 PM
    Owner
  • I think the answer is likely no. In few minutes of looking around, I do not see that mail app documents any uri protocol to launch it. For example - you can launch windows store app using a uri scheme. To be conclusive, you need to ask windows mail app team. I do not see any official blog for the team apart from this latest post on windows experience blog. You may post a comment there.

    Secondly, is there a specific reason to not use search charm? otherwise - that may serve the purpose.

    hth.


    -sushil

    Saturday, November 16, 2013 6:37 AM
  • Hi Sushil,

    "mailto" is a standard protocol supported by many (probably most) email applications, including the Windows Mail client. Using a custom protocol would be a bad idea since it would require the user have a specific email client. Using "mailto" will allow users to choose their own clients.

    As you suggest, the share charm may be an even better choice than locking the user into email. In general I'd recommend using the share charm for general sharing or connecting to a dedicated web service for targeted feedback scenarios.

    The share charm will allow the user to choose how and where to share the data.

    A web service will allow the app to send data to a specific location and doesn't rely on the user having an email client set up and pushing send on the default options in the mailto: link.

    Most email scenarios would be better off with one of these rather than taking a side trip through the email client.

    --Rob

    Tuesday, November 19, 2013 4:57 AM
    Owner