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. |
return | 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);
}