Altro codici interessanti che ho trovato
in rete che permettono di inviare mail HTML in LS.
1 - METODO LOTUS-SCRIPT:
Dim session as New NotesSession()
session.convertMIME = False ' Do not convert to rich text
Dim currentDb As NotesDatabase
Set currentDb = session.currentDatabase
Dim path As String
path = "c:\temp\test.html"
Dim message As NotesDocument
Set message = currentDb.createDocument()
Call message.replaceItemValue("Form", "memo")
Call message.replaceItemValue("From", "your@email.com")
Call message.replaceItemValue("Subject", _
"HTML email via MIME")
Call message.replaceItemValue("SendTo", "another@email.com")
Dim body As NotesMIMEEntity
Set body = message.CreateMIMEEntity
Dim mh As NotesMimeHeader
Set mh = body.CreateHeader({MIME-Version})
Call mh.SetHeaderVal("1.0")
Set mh = body.CreateHeader("Content-Type")
Call mh.SetHeaderValAndParams( _
{multipart/related;boundary="=NextPart_="})
Dim mc As NotesMIMEEntity
Set mc = body.createChildEntity()
Dim stream As NotesStream
Set stream = session.createStream()
If Not stream.open(path, "ISO-8859-1") Then
Error 2000, "Could not open file"
End If
Call mc.setContentFromText(stream, _
{text/html;charset="iso-8859-1"}, ENC_NONE)
Call stream.close()
Call addImage(body, "C:\temp\image1.gif")
Call addImage(body, "C:\temp\image2.gif")
Call message.send(False)
Public Sub addImage(body As NotesMimeEntity, _
imagePath As String)
Dim id As String
Dim stream As NotesStream
Dim mh As NotesMimeHeader
Dim mc As NotesMIMEEntity
id = Strrightback(imagePath, "\")
Set stream = session.createStream()
Set mc = body.createChildEntity()
Set mh = mc.createHeader({Content-ID})
Call mh.setHeaderVal(id)
Call stream.open(imagePath)
Call mc.setContentFromBytes(stream, _
"image/gif;name=""" + id + """",
ENC_IDENTITY_BINARY)
Call stream.close
End Sub
link
originale preso qui
2 - METODO CHIAMATA XML
http://www.crossedconnections.org/w/?p=45
Inviare html mail con Lotus script e XML - Altro ancora...
- 12/20/2005
- 1 commenti
1 Commenti:
Occorre aggiornare la sub addImage() per impostare il valore dell'intestazione Content-ID con i caratteri maggiore/minore attorno al valore id (nome immagine)..
Call mh.setHeaderVal("<" & id & ">")