1
votes

I am trying to send email from my WP8 App using EmailComposeTask. But it is not sending the mail. Please correct the code if i am missing some statements. My code is:

private void Button_Click_1(object sender, RoutedEventArgs e)
    {

        EmailComposeTask email = new EmailComposeTask();
        email.Body = "Test email from an app on click";
        email.Subject = "Testing";
        email.To = "[email protected]";
        email.Show();


    }

On clicking Button , i want this mail to be send to [email protected]. When i m running this app it asks for select an account from it will send mail after choosing it send the mail but reciever is not recieving the mail.

1
Code seems right to me. are you sure the email id is correct? Try checking your sent items in your email account.Rishabh876
yah rishabh email id is correct here.......I already checked in my send items also , it is not displaying any mail in sent box too.Krrish
code is absolutely right, try with adding cc,bcc and also put breakpoint for Debugging, may it help you outAmit Bhatiya
try some other account to send your email and tell me if it works.Rishabh876
I added cc and bcc too but it is not showing in sent box of choosed account tooKrrish

1 Answers

1
votes

There is no error in the code. EmailComposeTask is working as it should. It will always ask you to choose email account.
See this link: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394003%28v=vs.105%29.aspx

Same happens when you use a MediaShareTask, it will ask if you want to share on facebook/twitter/email etc etc. This is how they are programmed in Windows phone.