I only have one image to add, but the following sub just gives me the html text, as if I did no add the image lines
Dim subject As String
Dim Maildb As Object
Dim UserName As String
Dim MailDbName As String
Dim MailDoc As Object
Dim Session As Object
Dim body As Object
Dim stream As Object
Dim strImagePath As String
Dim strImageType As String
Dim strImageCid As String
Dim mimeImage As Object
Dim mimeImageHeader As Object
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
'Already open for mail
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
Dim mimeHTML As Object
Set stream = Session.CreateStream()
Set body = MailDoc.CreateMIMEEntity
subject = "Newsletter direzionale"
Set mimeHTML = body.CreateChildEntity()
Call stream.WriteText(fFaiPagina) produces the html body of the message.
Call mimeHTML.SetContentFromText(stream, "text/html;charset=iso-8859-1", ENC_IDENTITY_8BIT)
Call stream.Close
strImagePath = CurrentProject.path & "\ico_world.gif"
strImageCid = "ico_world.gif"
strImageType = "image/gif"
Set mimeImage = body.CreateChildEntity()
Set mimeImageHeader = mimeImage.CreateHeader("Content-ID")
Call mimeImageHeader.SetHeaderVal("<" & strImageCid & ">")
Call stream.Open(strImagePath)
Call mimeImage.SetContentFromBytes(stream, strImageType & ";name='" + strImageCid + "'", ENC_IDENTITY_BINARY)
Call stream.Close
Dim mandali As String
mandali = "Riccardo Baldinotti/Regione_Lombardia" a test message, sent to myself
MailDoc.sendto = mandali '
MailDoc.subject = subject
MailDoc.returnreceipt = "0"
MailDoc.SAVEMESSAGEONSEND = True
MailDoc.PostedDate = Now()
MailDoc.Send 0, mandali
Many thanks.