Hier der Code:
Listbox von VB:
For icounter = Me.lstMail.ListCount - 1 To 0 Step -1
KundenMail = Me.lstMail.List(icounter)
EMailadressen = EMailadressen & KundenMail & ","
Aufruf Notes:
SendNotesMail cboThema.Text, EMailadressen, (BodyTxt)
Email versenden mit Notes:
'Die Session starten
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
'Datenbank öffnen
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = False Then Maildb.OPENMAIL
'Ein neues Maildokument erstellen
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "MemoKDE"
MailDoc.BlindCopyTo = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
'MailDoc.ReturnReceipt = "1" 'e-Mail bestätigung vom Empfänger
'Eingebettete Objekte und Anhänge hinzufügen
Set NewObj = CreateObject("Scripting.FileSystemObject")
Set myFolder = NewObj.GetFolder("C:\" + k_Country)
Set AllFiles = myFolder.Files
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
For Each s_Files In AllFiles
i = InStr(s_Files, ".")
Datei = LCase(Mid(s_Files, i))
If Datei = ".pdf" Then
Attachment = s_Files
If Attachment <> "" Then
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
End If
End If
Next
'Senden
MailDoc.PostedDate = Now()
MailDoc.SEND 0, Recipient