How to send e-mail with attachments

To send e-mails with attachments you need to configure a notification representing a particular e-mail (see the “Sending Outgoing E-mail” section) and define attributes of the Document type that will hold the attachments – one attribute per attachment (see the “Attributes of Document Type” section). When you send e-mail using the SEND action you need to initialize these attributes with the particular documents (these can be generated reports, “merged documents” or ordinary files). Aware IM will automatically convert these documents into e-mail attachments. For example,

CREATE EmailToCustomer WITH EmailToCustomer.Attachment1='AnnualReport'
SEND EmailToCustomer TO Customer 

In this example EmailToCustomer is a notification representing the e-mail (the notification must have the Subject and Message attributes initialized to some text). This notification has the attribute Attachment1 of the Document type. AnnualReport is the name of the document template of the Report type (see the “Reports” section). When initializing the Attachment1 attribute Aware IM will generate the report, attach it to the attribute and convert it to the e-mail attachment when the e-mail is sent. Another example:

CREATE EmailToCustomer WITH EmailToCustomer.Attachment1='AnnualReport'
IMPORT DOCUMENT EmailToCustomer.Attachment2 FROM 'c:\MyDocuments\myfile.bin'
SEND EmailToCustomer TO Customer 

In this example EmailToCustomer is assumed to have the second attribute of the Document type called Attachment2. After the notification has been created the value of this attribute is imported from file. When the e-mail is sent the file is converted to the e-mail attachment.

  • Last modified: 2022/09/13 18:15