locked
Windows 8.1 Sharing Using Email

    Question

  • My app contains content (just plain simple text, multimedia, special file formats, or even HTML) that I want the user to be able to send in an email. All the sites that I have found have told me to do this using sharing and DataTransferManager. This would work, except for the fact that it would force the user to select email (as opposed to other types of sharing). I want to be able to open the user's default email app for them and set the body and subject (if I am unable to set the To is is not a problem, the user would be entering that anyway). In Windows Phone, we were able to use Windows.ApplicationModel.Email, but this is unavailable for Windows Store apps. How do I specify that I want the user to share the text as an email? I also tried using the mailto: protocol, and that works, but it is requires extra code to generate the Uri and sometimes special character formatting that should not be necessary. Thanks.

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/


    • Edited by Nathan Sokalski Sunday, December 21, 2014 1:39 AM Forgotten info
    Sunday, December 21, 2014 1:32 AM

Answers

  • That sounds like the perfect scenario for the sharing charm. Let users share via whichever method they'd like. Don't force them into email. Let them save it to OneNote, or share via Facebook, etc.

    If you want to force the user into email then you can do so, but you'll need to write the code yourself.

    Monday, December 22, 2014 7:27 PM
    Owner

All replies

  • Other than connecting directly to the email server those are your two options.

    What is your specific scenario? Why do you want to force the user to use email instead of letting the user choose how to share the app? 

    Sunday, December 21, 2014 1:47 AM
    Owner
  • My app is one for keeping track of people's gift lists, and what I want to share (the string that I want to set the email's body to) is just a text version of the data generated by the app. I want the user to have a quick and easy way to send the lists to their friends (or themselves) that they can print or view in a standard format (something that does not require using an app). Sending it as an email as plain text would give them the freedom to view or copy it anywhere they wanted, even places on other devices. Letting the user choose does, of course, not prevent them from putting it in an email, but I was hoping to make it a more straightforward one-step feature.

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Sunday, December 21, 2014 2:05 AM
  • Other than connecting directly to the email server those are your two options.

    What is your specific scenario? Why do you want to force the user to use email instead of letting the user choose how to share the app? 

    I can understand where the OP is coming from. I've had users of my apps where I had to walk them through on how to bring out the charms bar.  I've had users where selecting which printer to use was too much trouble.  For some people, anytime there's more than 1 choice is too many choices.

    Sunday, December 21, 2014 4:33 AM
  • That sounds like the perfect scenario for the sharing charm. Let users share via whichever method they'd like. Don't force them into email. Let them save it to OneNote, or share via Facebook, etc.

    If you want to force the user into email then you can do so, but you'll need to write the code yourself.

    Monday, December 22, 2014 7:27 PM
    Owner