Hi,
I'm rewriting some code to use Limilabs mail.dll instead of another mail component, and part of it involves sending a DSN message. For reference, this is the old code:
MailMessage envelope = new MailMessage();
envelope.From = new Address("Mail Delivery Subsystem", "MAILER-DAEMON@" + toAddress.Domain);
envelope.To.Add(message.From);
envelope.Subject = "Delivery notification (failure)";
envelope.Body =
"The original message was received at " + DateTime.Now.ToString("r") +
"\r\n----- The following addresses had permanent fatal errors -----" +
"\r\n<" + toAddress.EMail + ">\r\n" +
"\r\n----- Transcript of session follows -----" +
"\r\n... while talking to " + toAddress.Domain +
"\r\n>>> RCPT To:<" + toAddress.EMail + ">" +
"\r\n<<< 550 5.1.1 <" + toAddress.EMail + ">... User unknown" +
"\r\n";
// Generate a DSN message that contains the envelope
// message and the original messages
DSNMessage dsnMessage = new DSNMessage(envelope, message);
dsnMessage.ArrivalDate = DateTime.Now;
dsnMessage.OriginalEnvelopeID = message.MessageID;
dsnMessage.ReportingMTA = toAddress.Domain;
// Specify the recipients that the DSN will be sent to
DSNRecipient recipient = new DSNRecipient();
recipient.Action = DSNAction.Failed;
recipient.OriginalRecipient = message.From;
recipient.FinalRecipient = message.From;
recipient.RemoteMTA = message.From.Domain;
// Add recipients to DSN message
DSNRecipient[] recipients = new DSNRecipient[] { recipient };
dsnMessage.Recipients = recipients;
// Get the final DSN message
MailMessage bounceMail = dsnMessage.CreateDSNMessage();
How can I do something similar with Limilabs mail.dll?
Regards,
Patrick