Search code examples
c#windows-8.1windows-phone-8.1windows-rt

How send email with attachment in windows universall app


How can i send an email with attachment in windows universal app (windows phone 8.1 and windows 8.1)

Class Windows.ApplicationModel.Email.EmailMessage is available only for windows phone


Solution

  • There is no direct, in-box way to send an email in a Windows Store app.

    As you note, Windows.ApplicationModel.Email is available only for Windows Phone Runtime apps. This is one of the discontinuities in Universal apps where a feature is available on one platform but not both.

    Options are:

    • Use the share contract rather than explicitly forcing email. This is the preferred method in general, although there are specific cases for which it doesn't work
    • Connect to a web service. This is often the best solution for feedback since the app can provide a custom form and doesn't have to push the user through an external app. You could also use a web service which will forward to email on the server side.
    • Connect to the mail server directly and implement SMTP, POP, IMAP, etc. This is generally best for service specific apps which can expose their own share target.
    • Not relevant for your case, but if you didn't need the attachment you could launch a mailto: URI