The Contents collection contains all content files. The collection can be used to determine the value of a specific content item, or to iterate through the collection and retrieve a list of all items in the message.
Content = Object.Contents(key|index)
Returns a Content Object
In the following example, a specific content is removed on the Mail_OnStartRender event
Sub Mail_OnStartRender
If Record.Fields("Details") = False Then
Mail.Contents.Remove("Details")
End If
End Sub
In the following example, a content is added on the Mail_OnStartRender event
Sub Mail_OnStartRender
Set oContent = Mail.Contents.Add "My new content" 'Add a content named "My new content"
oContent.Data = "Hello this is a test message" 'Add the text data inside of it
oContent.Type = "text/plain" 'Set the content-type
oContent.Headers("X-Body") = 1 'Specify that the content is part of the body
End Sub