I’m working on my About page for a Windows Phone Runtime app and needed to be able to send an email for feedback or support issues.
Below is the code for my event handler in the code behind (AboutPage.cs):
async private void Image_Email(object sender, TappedRoutedEventArgs e) { //Define email address to send to EmailRecipient sendTo = new EmailRecipient() { Address = "mail@domain.com" }; //New email and define email subject EmailMessage mail = new EmailMessage(); mail.Subject = "Linux Essentials - Feedback"; //Add addressee to email mail.To.Add(sendTo); //Open share contact with email only await EmailManager.ShowComposeNewEmailAsync(mail); }
The XAML on my About page is simply an image with the Tapped event:
<Image Source="Assets/Images/Mail.png" Height="64" Width="64" Margin="0,0,22,0" Tapped="Image_Email"/>
When defining a new email you can also specify the mail body text:
mail.Body = "this is the Body";
Source: http://dotnet.dzone.com/articles/how-send-mail-your-windows