Sending an Email from Windows Phone

by CameronM 15. February 2011 07:03

To help get feedback, complaints and problems from users of our Windows Phone apps on the Marketplace we have started to include an ‘email us’ link. This link uses the email launcher task called EmailComposeTask to fill in the recipient (our email), and the Subject (our application name). 

The EmailComposeTask launches the email application on the OS, which prompts the user to select the account they want to use, for instance Live or Outlook. Once they select the account, they new email message is displayed and they have the option to edit the subject line, message body or even cancel sending the email altogether.

private void Button_Click(object sender, RoutedEventArgs e)

{

    EmailComposeTask emailComposeTask = new EmailComposeTask();

    emailComposeTask.To = "sales@GreatApp.com";

    emailComposeTask.Body = "I love this application";

    emailComposeTask.Subject = "Great App";

    emailComposeTask.Show();

}

Tags: ,

WP7