locked
Sharing With an Email App: How do I set the Email Properties?

    Question

  • From what I have read, the suggested way to have a Windows Store app send an email is to use the Share feature. I think I understand how to use DataTransferManager and the DataRequested event, but I am not quite sure how to specify everything for the email. Even though I intend for my users to only share using email, I still need to use the DataRequest object to specify what I want to share. When using classes designed for email, such as Windows.ApplicationModel.Email.EmailMessage (for Windows Phone), there were properties for all the different parts of an email (Subject, Body, Attachments, etc.). But because DataRequest is not optimized for email, I would like to know how to specify all the things I was able to specify in EmailMessage using DataRequest so that I can fill in all the same information for the user. Is there anywhere that I can go to see a list of how each component can be specified? Thanks.

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

    Wednesday, February 11, 2015 11:18 PM

Answers

  • No, there is no way to enforce an email app or to fill in arbitrary fields on the chosen app.

    Trying to specifically target email violates the point of sharing and is unnecessarily limiting to your users. The point of sharing which is to let the app provide the data and the target to use it however it would like (I may want to share to my OneNote, for example).

    There are only a few scenarios where limiting the user to specific media is more appropriate than letting the user choose, and in those cases you can use other means such as mailto: or directly connecting to a server.

    Thursday, February 12, 2015 3:55 AM
    Owner

All replies

  • You can't share to a specific app, so you can't set properties used by a specific app.

    You share data and the user chooses how to share it and to whom.

    --Rob

    Thursday, February 12, 2015 12:57 AM
    Owner
  • I didn't mean a specific app, I don't care what email app they use (and I realize that I can't force them to use an email app rather than something other type of sharing), but when they do choose email, I want to know how to set all the possible components. How do I set the subject? How do I set the body? How do I attach an attachment? If we are this limited by sharing, is there a way to launch the default email app with specified values for the desired components? I would find it hard to believe that we would have as much control for sending email in a Windows Phone app as we do, but not have a way to do the same thing in a Windows Store app.

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

    Thursday, February 12, 2015 1:09 AM
  • No, there is no way to enforce an email app or to fill in arbitrary fields on the chosen app.

    Trying to specifically target email violates the point of sharing and is unnecessarily limiting to your users. The point of sharing which is to let the app provide the data and the target to use it however it would like (I may want to share to my OneNote, for example).

    There are only a few scenarios where limiting the user to specific media is more appropriate than letting the user choose, and in those cases you can use other means such as mailto: or directly connecting to a server.

    Thursday, February 12, 2015 3:55 AM
    Owner