Crystalbyte.Equinox.Imap.ImapClient.FetchAttachment C# (CSharp) 메소드

FetchAttachment() 공개 메소드

Fetches a single attachment from the requested message.
public FetchAttachment ( Crystalbyte.Equinox.Imap.AttachmentInfo info ) : Attachment
info Crystalbyte.Equinox.Imap.AttachmentInfo The associated info object, this token can be obtained from the messages body structure.
리턴 Attachment
        public Attachment FetchAttachment(AttachmentInfo info)
        {
            var base64String = FetchEntityText(info);
            if (string.IsNullOrEmpty(base64String)) {
                return null;
            }
            var bytes = Convert.FromBase64String(base64String);
            return Attachment.FromBytes(info.Name, bytes, info.MediaType);
        }