|[Top] [Chapter] [Previous] [Next]|
Emails contain plain text, possible HTML text with images and further attachments. The creation and collection of all this data is not an easy task. If a document contains embedded images, first image files have to be created so the HTML part of the e-mail can link to them.
The TextDynamic interface IWPMapi makes it easy to prepare the e-mail data. You are then free to either use the MapiSendMail function to send it (call Send) or you can read the properties and send the e-mail using a different tool. In this case you only have to interpret the list provided by AttachmentList.
When you execute Prepare the e-mail will be created, all attachments will be written. By default the e-mail will be created with the body as ANSI text and the document as HTML attachment. If you want the e-mail body to be HTML formated text, first assign the string "<html>" to the property Body .
Prepare: Collect the data for an e-mail. This clears the attachment list.
Send: Send the e-mail which was prepared last. If no e-mail was prepared the document from editor 1 will be send to the e-mail client. (Internally the Windows API MAPISendMail is used. The parameter lhSession is passed as 0, ulUIParam can be set using the method SetAppHandle, lpMessage will be automatically prepared and flFlags can be set using the property MAPIFlags)
Send2: Send the e-mail which was prepared last. If no e-mail was prepared the document from editor 2 will be send to the e-mail client.
Clear: Resets the properties Subject, FromName, FromAddress, Recipients, CCList,BCCList, AttachmentList, Body.