wir setzen zum Versand von EMail Lotus Notes in der Version 8 ein.
Aus Excel gelingt es mir E-Mails zu erstellen (siehe unten). Wir habe sog. Teamboxen, also zusätzliche Mail-Datenbanken, in unserer Maildatenbank integriert (Lesezeichen).
Leider gelingt es mir nicht, eine Email über diese Datenbank (eigene Email Adresse) zu versenden. Er nimmt als Absender immer meine akuelle Datenbank und damit Email Adresse.
Bsp.: persönliche Datenbank: personal.nsf; Gruppendatenbank: gruppe.nsf
Hat jemand eine Idee?
Vielen Dank für die Mühe.
Aktuell verwendeter Code:
Dim objNotesSession As Object
Dim objNotesMailFile As Object
Dim objNotesDocument As Object
Dim objNotesField As Object
Sub SendMail()
On Error GoTo SendMailError
EMailSendTo = "test@test.de" '' Required - Send to address
EMailCCTo = "" '' Optional
EMailBCCTo = "" '' Optional
EmailSubject = "Automatische Nachricht"
''Establish Connection to Notes
Set objNotesSession = CreateObject("Notes.NotesSession")
''Establish Connection to Mail File
'' .GETDATABASE("SERVER", "FILE")
Set objNotesMailFile = objNotesSession.GETDATABASE("", "doc\Mail-In-Datenbanken\Gruppenkonto. _
nsf")
''Open Mail
objNotesMailFile.OPENMAIL
''Create New Memo
Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT
''Create 'Subject Field'
Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject", EmailSubject)
''Create 'Send To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EMailSendTo)
''Create 'Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EMailCCTo)
''Create 'Blind Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("BlindCopyTo", EMailBCCTo)
''Create 'Body' of memo
Set objNotesField = objNotesDocument.CREATERICHTEXTITEM("Body")
With objNotesField
.APPENDTEXT "Automatisch erstellte e-mail"
.ADDNEWLINE 1
.APPENDTEXT "mit Beispieltext"
.ADDNEWLINE 2
End With
''Attach the file --1454 indicate a file attachment
'objNotesField = objNotesField.EMBEDOBJECT(1454, "", "C:\?.?")
'objNotesField = objNotesField.EMBEDOBJECT(1454, "", ActiveWorkbook.FullName)
''Send the e-mail
objNotesDocument.SEND (0)
''Release storage
Set objNotesSession = Nothing
Set bjNotesSession = Nothing
Set objNotesMailFile = Nothing
Set objNotesDocument = Nothing
Set objNotesField = Nothing
Exit Sub
SendMailError:
msg = "Error # " & Str(Err.Number) _
& Err.Source & Chr(13) & Err.Description
MsgBox msg, , "Error", Err.HelpFile, Err.HelpContext
End Sub