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


This content was proof-read by Grammarly. You can Try Grammary for FREE

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);
?
Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

%d bloggers like this: