Copyright © 2024 IMIBO. Privacy Statement
Extended MAPI in DELPHI
Experimental # 2
„Smart“ Mailer
Long time ago, we received a request for developing a very simple method for sending messages with attachments and HTML body.
We decided that the „best“ solution will be a custom class based on TObject.
What’s easier than that:
// Send Message with TMailer.Create(Application) do try SendMail(ListBoxTO.Items, // TO recipients - can be nil ListBoxCC.Items, // CC recipients - can be nil ListBoxBCC.Items, // BCC recipients - can be nil ListBoxAttachements.Items, // Attachments - can be nil Trim(ebSubject.Text), // Subject - optional BodyText, // Message Body - Plain - optional BodyHTML, // or Message Body as HTML - optional cbConfirmRead.Checked, // RECEIPT REQUESTED - optional True // Move to Sent Items folder??? - optional ) finally Free; end;