Xamarin.Essentials的文件附件

时间:2019-02-12 11:09:01

标签: xamarin.forms email-attachments

使用Xamarin Essentials电子邮件类,我可以通过这种方式打开默认电子邮件应用程序

public async Task SendEmail(string subject, string body, List<string> recipients)
{
    try
    {
        var message = new EmailMessage
        {
            Subject = subject,
            Body = body,
            To = recipients,
            //Cc = ccRecipients,
            //Bcc = bccRecipients
        };
        await Email.ComposeAsync(message);
    }
    catch (FeatureNotSupportedException fbsEx)
    {
        // Email is not supported on this device
    }
    catch (Exception ex)
    {
        // Some other exception occurred
    }
}

是否可以在代码中附加文件?我在api中找不到任何选项。

0 个答案:

没有答案