public void AttachFile(string fileName) { FileAttachments.Add(fileName); }
/// <summary> /// Creates a new mail merge message. /// </summary> /// <param name="subject">Mail message subject.</param> /// <param name="plainText">Plain text part of the mail message.</param> /// <param name="htmlText">HTML message part of the mail message.</param> /// <param name="fileAtt">File attachments of the mail message.</param> public MailMergeMessage(string subject, string plainText, string htmlText, IEnumerable <FileAttachment> fileAtt) : this(subject, plainText, htmlText) { fileAtt.ToList().ForEach(fa => FileAttachments.Add(fa)); }
/// <summary> /// Add a file attachment that will be attached to the PDF file. /// </summary> /// <param name="attachment">The file attachment as a byte array.</param> /// <param name="fileName">The filename of the file attachment.</param> /// <param name="description">The description of the file attachment.</param> public void AddFileAttachment(byte[] attachment, string fileName, string description) { _resources.Add(attachment); FileAttachments.Add(new FileAttachment( "job-resource:" + (_resources.Count - 1), fileName, description)); }