Ghazanfar Khan
Ghazanfar Khan

Reputation: 3718

Send email from windows phone 8.1

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 = "[email protected]"
};

//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.

Upvotes: 8

Views: 4984

Answers (3)

Chris Shao
Chris Shao

Reputation: 8231

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.

Upvotes: 2

Metehan Toksoy
Metehan Toksoy

Reputation: 1935

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

Upvotes: 3

Balasubramani M
Balasubramani M

Reputation: 8338

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".

Upvotes: 4

Related Questions