Email Compose Task
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
AmanRank #607 · 3.9K reputationPosted Oct 10, 2014, 10:39 AM EDT
Earlier it was very easy task to send mail from your app in windows phone 8 by just using the EmailComposeTask but it has been removed in windows phone 8.1.
In windows phone 8.1 there is an EmailManager , by using this we can send mail in windows phone 8.1.
So lets start to write code for this. First of all add a Button in your windows phone 8.1 project and in its event write the following line of code:
private async void sendMailButton_Click(object sender, RoutedEventArgs e)
{
//Adding the address to which we have to send the mail
EmailRecipient mailTo = new EmailRecipient
{
//Email address of the Recipient
Address="[email protected]"
};
EmailMessage message = new EmailMessage();
message.Subject = "WP 8.1 Email Task";
message.Body = "Sending my first mail from Windows Phone 8.1";
message.To.Add(mailTo);
//we can also add cc as well as bcc
//message.CC.Add(mailTo);
// message.Bcc.Add(mailTo);
await EmailManager.ShowComposeNewEmailAsync(message);
}
I am including the Source code also, you can download it.
If it helps you then please Accept it as Answer.
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 4:46 AM EDT