■ IEmail 인터페이스의 ComposeAsync 메소드 사용시, 첨부 파일을 추가하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
if(Email.Default.IsComposeSupported) { string[] recipientArray = new[] { "john@contoso.com", "jane@contoso.com" }; string subject = "Hello friends!"; string body = "It was great to see you last weekend. I've attached a photo of our adventures together."; EmailMessage message = new EmailMessage { To = new List<string>(recipientArray), Subject = subject, BodyFormat = EmailBodyFormat.PlainText, Body = body }; string filePath = Path.Combine(FileSystem.CacheDirectory, "memories.jpg"); message.Attachments.Add(new EmailAttachment(filePath)); await Email.Default.ComposeAsync(message); } |