且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从wp7向gmail帐户发送电子邮件

更新时间:2022-11-16 23:34:20

您可以使用EmailComposeTask使用电话上的一个电子邮件帐户向您发送电子邮件.请记住,此方法意味着用户将可以进行编辑,然后可能不发送电子邮件,但这是最简单的方法之一.

You can use the EmailComposeTask to use one of the email accounts on the phone to send you an email. Keep in mind that this method means that the user will get to edit and then possibly not send the email, but it is one of the simplest ways.

Microsoft.Phone.Tasks.EmailComposeTask emailComposeTask = new Microsoft.Phone.Tasks.EmailComposeTask();
 emailComposeTask.To = "tomail@localhost.com";
 emailComposeTask.Cc = "ccmail@localhost.com";
 emailComposeTask.Subject ="Your Subject here";
 emailComposeTask.Body = "Your mail content here";
 emailComposeTask.Show(); // Launches send mail screen



如果您希望用户完全不参与,那么我建议您在线使用一个Web服务,该服务将接收您想要发送的消息,并使用您已经提到的ASP.NET之类的东西来进行处理.



If you are looking to have the user not involved at all then I would suggest a web service online that would take the message you want to send and have it do it using something like ASP.NET like you already mentioned.