If you want to use Microsoft.Phone.Tasks
, you must create Windows Phone Silverlight 8.1 project. And if your project is Windows Phone 8.1,
you can use this code to phone call:
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI("phone number", "display name");
and use this to send sms:
Windows.ApplicationModel.Chat.ChatMessage msg = new Windows.ApplicationModel.Chat.ChatMessage();
msg.Body = "This is body of demo message.";
msg.Recipients.Add("10086");
msg.Recipients.Add("10010");
await Windows.ApplicationModel.Chat.ChatMessageManager.ShowComposeSmsMessageAsync(msg);
and use this to send mail:
Windows.ApplicationModel.Email.EmailMessage mail = new Windows.ApplicationModel.Email.EmailMessage();
mail.Subject = "This is Subject";
mail.Body = "This is body of demo mail";
mail.To.Add(new Windows.ApplicationModel.Email.EmailRecipient("[email protected]", "shaomeng"));
await Windows.ApplicationModel.Email.EmailManager.ShowComposeNewEmailAsync(mail);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…