I’ve tried to send email in a Windows Store App by using following code:
var mailto = new Uri("mailto:?to=recipient@example.com&subject=The subject of an email&body=Hello from a Windows 8 Metro app.");
await Windows.System.Launcher.LaunchUriAsync(mailto);
It was not showing any Errors but I didn’t receive any emails. What was wrong from above code?
Your code should open the default mail client (i.e. the default application for handling
mailto:protocol) with all the information in the link. If it doesn’t, you probably don’t have the default application set up correctly. This happened to me at first, before I select theMailapplication to handle this protocol.Still, you probably don’t want such an experience for your user for at least two reasons:
Mailis the default app, your code will only create a new draft and the user will have to send it himself.Depending on what you want to achieve, I’d consider one of the following approaches: