Sending an email in metro application?

泪湿孤枕 提交于 2019-12-31 03:52:47

问题


I want to send an email with some content as a body in my metro app :-

1)since system.net.mail is not supported in metro application i have decided to use this :-

using Windows.System;
//starts the default mail app with a subject, cc, bcc, and body
Launcher.LaunchUriAsync(new Uri("mailto:windows8devs@almostbeta.com?subject=Code Request&cc=kevin@almostbeta.com&bcc=admin@almostbeta.com&body=Hi!"));

but my doubt is that i want to generate a content as a body to this email , but this content is of html type , i mean this body is of type html (specifiying some text or content in between the html tags)

Please let me know how can i do this , i.e setting a simple html type body to as a body to this email which i would like to send through my application.

Am i going wrong , pls let me know and correct me if i am wrong .

Thanks in Advance.


回答1:


The email story in WinStore apps is pretty broken right now. You can either use mailto: with no content or use share charms with no email details. I suspect they must enable support for some email document contracts at some point in the future, but I don't think it is available yet.

*EDIT

It also sounds like a great opportunity for someone to write a web service to send emails if a good one doesn't already exist. You could of course write one yourself.




回答2:


This is not the correct usage of the Win8/Metro design language. You want to enable support for the "Share Source" contract. Here is the link to the sample/support for how to use the sharing contract:

http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Target-App-e2689782

It lets you specify a body (content), though the user could also choose to share it to something other than mail, and you don't get to specify an email address. There are several email sending services out there, and that might be a better solution if the user doesn't have to edit the email before it is sent.



来源:https://stackoverflow.com/questions/12969059/sending-an-email-in-metro-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!