Below is a sample code snippet that demonstrates how to send email with attachments programmatically in Windows Phone 8.1 using C# .

How to Programatically Send Email with attachments in Windows Phone 8.1 using C# ?

EmailMessage objEmail = new EmailMessage();
objEmail.Subject = "Abundantcode Article";
var localAppFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
var fileHandle = await localAppFolder.CreateFileAsync("AbundantcodeData.txt", Windows.Storage.CreationCollisionOption.ReplaceExisting);
objEmail.Attachments.Add(new EmailAttachment(fileHandle.Name, fileHandle));
await EmailManager.ShowComposeNewEmailAsync(objEmail);
?
3 thoughts on “How to Programatically Send Email with attachments in Windows Phone 8.1 using C# ?”
  1. Thanks for this. I get a System.NotImplementedException when I call await EmailManager.ShowComposeNewEmailAsync(objEmail); but the app’s target is WP8.1 and am building to 8.1 emulator. Any idea why?

  2. Hi,
    I know it is a stupid question. Can you please tell me how can i import EmailMessage class?. No way i am able to load this class. I have imported
    using Microsoft.Phone.Tasks;
    using System.Net.Mail;
    using System.Net.Mime;

    But no luck. Can you please help me.

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

Liked this content?. Please spread the word :)

  • RSS
  • Twitter
    Visit Us
    Follow Me