Hello ,
I download a file and email it with a button .
But i want to download the file and show it in a Pdfviewer.
How do i make this work ?
async void Button_Clicked(object sender, EventArgs e)
{
HttpClient client = new HttpClient();
var response = await client.GetAsync("http://africau.edu/images/default/sample.pdf");
var bytes = await response.Content.ReadAsByteArrayAsync();
var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "sample.pdf");
File.WriteAllBytes(file, bytes);
var message = new EmailMessage
{
Subject = "Hello",
Body = "World",
};
message.Attachments.Add(new EmailAttachment(file));
await Email.ComposeAsync(message);
}