How to send email in Windows Phone 7 using c# ?

In one of my previous post , i wrote about how one can send SMS in Windows Phone 7  using c# . This blog post focusses on sending a email in windows phone 7 using c#

Similar to sending SMS , sending email can be achieved with the EmailComposeTask

EmailComposeTask is a launcher that allows the windows phone 7 app to launch the email App aling with the message to be displayed which allows the users to send the email from your app.

To use the EmailComposeTask , you must include the namespace Microsoft.Phone.Tasks .

Using Microsoft.Phone.Tasks ;
This namespace can be found in the Microsoft.Phone.dll
To send the email , create an instance of the EmailComposeTask and set the appropriate properties like
To , Subject and Body of the Email .
private void button1_Click(object sender, RoutedEventArgs e)
{
     EmailComposeTask emailcomposer = new EmailComposeTask();
     emailcomposer.To = "test@ginktage.com";
     emailcomposer.Subject = "subject from test app";
     emailcomposer.Body = "This is a test mail from Email Composer";
     emailcomposer.Show();
}

When the Show method is called , the EmailComposer is opened which lets the user to click the send button to send the email
Note that you might the following message when email account is not set up in your windows phone 7 .

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

3 Comments

  1. How to send email in Windows Phone 7 using c | ProgramInDotnet August 1, 2011 Reply
  2. Nick Heiner August 9, 2011 Reply
  3. Mike November 29, 2011 Reply
  4. Rohit Baghela January 6, 2014 Reply

Leave a Reply


x

Interesting BlogPosts to read

How to get an Enumerator from range of elements from ArrayList in C# ?
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of ...
How to check for the column name in an SqlDataReader Object in C# ?
When working in ADO.NET for data access , there are times when you want to check to see if a column ...
Download - Pokemon Go for for Windows 10 (Third Party app)
Pokemon Go is one of the popular AR games for android and iOS devices and now , the game is made ava...