Creating an Email Message
Creating an Email Message
To create an email message, do the following:
-
Create an instance of %Net.MailMessageOpens in a new tab.
Tip:You can specify a character set as the argument to %New(); if you do so, that sets the Charset property for the message.
For information on character sets and translation tables, see Translation Tables.
-
Set the To, From, and Subject properties of your instance. These properties are required.
-
To—The list of email addresses to which this message will be sent. This property is a standard InterSystems IRIS list; to work with it, you use the standard list methods: Insert(), GetAt(), RemoveAt(), Count(), and Clear().
-
From—The email address this message is sent from.
-
Subject—The subject of the message.
-
-
Optionally set Date, Cc, Bcc, and other properties. For details, see Basic Headers.
-
If you are creating a single-part message, specify the contents and headers as described in Specifying the Content and Headers of a Message Part.
-
Or, if you are creating a multipart message, do the following:
-
Set the IsMultiPart property to 1.
-
Set the MultiPartType property to one of the following: "related", "alternative", or "mixed".
-
For each part that the message should contain, create an instance of %Net.MailMessagePartOpens in a new tab. Then specify the contents and headers as described in Specifying the Content and Headers of a Message Part.
-
For the parent email message, set the Parts property, which is an array. Insert each child message part into this array.
-