Email Sending Task in Windows Phone Universal App
- by Tanvir Sourov
I was trying to write an Email sending code for Windows Phone Universal App. This is the Code that I have written in my Event Handler:
Windows.ApplicationModel.Email.EmailMessage email = new Windows.ApplicationModel.Email.EmailMessage();
email.Subject = "Good morning";
email.Body = "Hello, how are you?";
var emailRecipient = new Windows.ApplicationModel.Email.EmailRecipient(email.Address);
email.To.Add(emailRecipient);
await Windows.ApplicationModel.Email.EmailManager.ShowComposeNewEmailAsync(emailMessage);
This code works for my Windows Phone 8.1 App. But it's not working in the Universal App. Shall I have to add any reference? Is there any way to make it work in the Universal app?
Thanks a lot. :)