private EMailAttachmentDTO HentAttachmentBillede(string path) { EMailAttachmentDTO billede = null; if (File.Exists(path)) { billede = new EMailAttachmentDTO(); billede.Navn = Path.GetFileName(path); billede.Data = File.ReadAllBytes(path); } return billede; }
private static EmailAttachment Map(EMailAttachmentDTO emailAttachmentDTO) { EmailAttachment emailAttachment = null; if (emailAttachmentDTO != null) { emailAttachment = new EmailAttachment(); emailAttachment.Name = emailAttachmentDTO.Navn; emailAttachment.Content = emailAttachmentDTO.Data; } return emailAttachment; }