// Spludlow Software // Copyright © Samuel P. Ludlow 2020 All Rights Reserved // Distributed under the terms of the GNU General Public License version 3 // Distributed WITHOUT ANY WARRANTY; without implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE // https://www.spludlow.co.uk/LICENCE.TXT // The Spludlow logo is a registered trademark of Samuel P. Ludlow and may not be used without permission // v1.14 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data; namespace Spludlow.Email { public class SimpleMailMessage { public string XSender; public string XReceiver; public string Subject; public string TextBody; public string HTMLBody; public string BCC; public string CC; public string To; public string From; public string ReplyTo; public string ReturnPath; public DateTime ReceivedTime; public DateTime SentOn; // Addresses [0] = Address, [1] = Display if no display then copy from address public string[][] BCCAddress; public string[][] CCAddress; public string[][] ToAddress; // use x-receiver if not present public string[][] FromAddress; // use x-sender if not present public string[][] ReplyToAddress; // Same as FromAddress if not specifed public string[][] ReturnPaths; // From headers (seems aleays present) empty if not // Attachments [0] Store Filename, [1] Filename, [2] MIME public string[][] Attachments; public DataTable AttachmentsTable = null; public SimpleMailMessage(string filename) { Spludlow.Email.CDOSYS.ReadSimpleMailMessage(this, filename, null); } public SimpleMailMessage(string filename, string attachmentsDirectory) { Spludlow.Email.CDOSYS.ReadSimpleMailMessage(this, filename, attachmentsDirectory); } public void FixForXML() { if (this.TextBody.Length > 0) { if (Spludlow.Serialization.ValidateForXML(this.TextBody) == false) this.TextBody = Spludlow.Serialization.FixString(this.TextBody); } if (this.HTMLBody.Length > 0) { if (Spludlow.Serialization.ValidateForXML(this.HTMLBody) == false) this.HTMLBody = Spludlow.Serialization.FixString(this.HTMLBody); } } } }