Examples: CreateMIMEEntity method

This agent creates a mail message in MIME format.

Sub Initialize
  Dim s As New NotesSession
  Dim db As NotesDatabase
  Dim doc As NotesDocument
  Dim body As NotesMIMEEntity
  Dim header As NotesMIMEHeader
  Dim stream As NotesStream
  Set db = s.CurrentDatabase
  Set stream = s.CreateStream
  s.ConvertMIME = False ' Do not convert MIME to rich text
  Set doc = db.CreateDocument
  Call doc.ReplaceItemValue("Form", "Memo")
  Set body = doc.CreateMIMEEntity
  Set header = body.CreateHeader("Subject")
  Call header.SetHeaderVal("MIME message")
  Set header = body.CreateHeader("To")
  Call header.SetHeaderVal("Roberta Person")
  Call stream.WriteText("Text of message.")
  Call body.SetContentFromText _
  (stream, "text/plain;charset=UTF-8", ENC_NONE)  
  Call doc.Send(False)
  s.ConvertMIME = True ' Restore conversion
End Sub