Subject: Send iCal as mime content with text/calendar type…
For example:Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim ws as New NotesUIWorkSpace
Set cdoc = ws.CurrentDocument.Document
dim rtiBody as NotesRichTextItem
Dim doc As New NotesDocument(db)
Set db = session.CurrentDatabase
dim subj As String, user As String
user = ’ “...@gmail.com”
dim icsText as String 'iCalendar text
icsText = … 'set iCalendar text from your source
Dim parent As NotesMimeEntity
Dim child1 As NotesMimeEntity
Dim child2 As NotesMimeEntity
Dim header As NotesMimeHeader
Dim stream As NotesStream
session.ConvertMime = False
’ Create all the Entities - one parent, two children.
Set parent = doc.CreateMIMEEntity
Set child2 = parent.CreateChildEntity
Set child1 = parent.CreateChildEntity(child2)
’ Create so that children 1 & 2 are siblings
’ Update all the header information.
’ At this point we cannot create another “Content-Type”
’ entity on the parent, but we can update the existing value
Set header = parent.GetNthHeader(“Content-Type”)
Call header.SetHeaderValAndParams({multipart/alternative; boundary="} _
& child1.BoundaryStart & {"})
Set header = child2.CreateHeader(“Content-ID”)
Call header.SetHeaderVal(“<1” & doc.UniversalID & “>”)
’ Build the entire HTML table, including a reference _
’ to an image that is yet to come (its ID
’ was created above). This HTML goes into child 1
Set stream = session.CreateStream
Call stream.WriteText({
})
Call stream.WriteText({
| })
Call stream.WriteText({<img src=cid:1} & doc.UniversalID & {>})
Call stream.WriteText({ |
})
Call child1.SetContentFromText(stream, “text/html”, ENC_NONE)
Call stream.Truncate
Call stream.WriteText(icsText)
Call child2.SetContentFromText(stream, “text/calendar”, ENC_NONE)
Call child2.EncodeContent(ENC_BASE64)
Call stream.Close
call doc.CloseMIMEEntities(True)
call doc.Save(true, true)
Call doc.Send( False, user)