0
votes

I am creating a windows 8 app to send mail from the entered fields. There are two approaches that i have tested and tried. But each one has its own limitation. My requirement is simple to send mail via outlook desktop app for the user. The content body of the mail is well formatted hence I used HTML to create it(Other ways if any let me know), there is an image attachment also of the InkManager used to take user sign.

Approach 1: Use share charm. All things work well but some times the app stops sharing then I need to restart or logoff from that account and then again login. And the clients wants to open his/ her outlook

Approach 2: Use mailto and open using Launcher.LaunchUriAsync it gives me an option to choose outlook but I can't set the HTML content formatted and unable to put the InkManager used to take user sign as an image

How can I solve this issue?

2
Unfortunately, there's no alternative way :(Farhan Ghumra

2 Answers

0
votes

If you need to send the mail from the user's account these are the only two ways. Alternatives are using an external web service as Filip suggested or sending it directly from the app using a mail API such as Mail for Windows Store.

I have another remark regarding the first approach, though. In my experience the sharing typically stops working until the next logon when an app does something wrong handling the DataRequested event - this breaks the share charm for all the apps. If it happens to you during development or testing your own app, make sure you handle any exceptions that might happen in the event handler and also check that you are adding and removing the event handler properly. Also avoid stopping the app within this event handler when debugging. This should prevent the issue from occuring.

0
votes

The best way right now is to write/connect to a web service that sends the mail. I think there might be existing ones out there.