Send email from windows phone 8.1

时光怂恿深爱的人放手 提交于 2019-12-09 10:08:51

问题


I want to sent an email from windows phone 8.1 app.Email Compose task not working in it. I tried this

EmailRecipient sendTo = new EmailRecipient()
{
    Address = "abc@outlook.com"
};

//generate mail object
EmailMessage mail = new EmailMessage();
mail.Subject = "Feedback";


//add recipients to the mail object
mail.To.Add(sendTo);
//mail.Bcc.Add(sendTo);
//mail.CC.Add(sendTo);

//open the share contract with Mail only:
await EmailManager.ShowComposeNewEmailAsync(mail);

This gives an error in the emulator:

Can't share
There are no apps to share with.


回答1:


You don't have any Email accounts in your emulator to share from that account. If you want to send an email, you should have an account right?

So go to email + accounts in Settings menu and add an account of any type in Emulator. Once you finish adding an email account, try deploying the app in the Emulator and perform the task. You should able to see Email task right now.

Since there is no email account in the emulator, "It shows no apps to share, Can't share now".




回答2:


On emulator, login with your Microsoft account and try again. I solved this with login account.




回答3:


You can test it on Device. Because on your Emulator, there are not any mail account at all. So when you call ShowComposeNewEmailAsync method, it can't find any target. Or you can add account on your Emulator in Setting -> email+account.



来源:https://stackoverflow.com/questions/24816227/send-email-from-windows-phone-8-1

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