简体   繁体   中英

How to send Email using EmailComposeTask from Wp8 application in code bedind?

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 = "amittal776@gmail.com";
        email.Show();


    }

On clicking Button , i want this mail to be send to amittal776@gmail.com. When im 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM