The Mail_OnStartRender event occurs when rendering starts for a mailing receiver. The Mail_OnStartRender event is a good time for you to set any receiver-wide variables, because they will be set before any contents are rendered.
Sub Mail_OnStartRender
. . .
End Sub
Sub Mail_OnStartRender()
    ' Sets a X-Subscriber-ID: header field
to trace the subscriber if the mail fails
    Mail.Headers("X-Subscriber-ID") =
Record.Fields("ContactID")
    ' Sets that today's subject 
    Mail.Subject = FormatDateTime(Date,2) & ":
Today's F1 racing news"
    ' Remove non necessary mail contents
    If Record.Fields("PreferredFormat") = "PDF"
Then
        Mail.Contents.Remove("HtmlNews")
        Mail.Contents.Remove("TextNews")
    Else If Record.Fields("PreferredFormat") =
"HTML" Then
        Mail.Contents.Remove("PDFNews")
        Mail.Contents.Remove("TextNews")
    Else ' The subscriber wants a text based email
        Mail.Contents.Remove("PDFNews")
        Mail.Contents.Remove("HtmlNews")
    End If
End Sub
Receivers set in the Record object as well as predefined content files will be added before Mail_OnStartRender is called.
Mail_OnEndRender, Mailing_OnStartRender