I am trying to send e-mails from Lotus Notes (5.0.10) from VB. I have found plenty of code in the FAQ's and elsewhere that performs this task thread707-1172968.
Unfortunately I can't manage to bypass the password prompt. Several examples require that you initialize the session with the line:
Session.Initialize("password")
Unfortunately, this doesn't seem to work for me. I can initialize the session but I can't seem to open the mail database with the Lotus.NotesSession class.
If anyone can help me or point me in the direction of a solution I would be very appreciative.
Unfortunately I can't manage to bypass the password prompt. Several examples require that you initialize the session with the line:
Session.Initialize("password")
Unfortunately, this doesn't seem to work for me. I can initialize the session but I can't seem to open the mail database with the Lotus.NotesSession class.
If anyone can help me or point me in the direction of a solution I would be very appreciative.
Code:
Private Sub SendMail(Subject As String, attachment As String, recipient As String, bodytext As String, saveit As Boolean)
Rem Dim session as New NotesSession
Dim session As NotesSession
Dim UserName As String
Dim MailDbName As String
Dim Maildb As Object
Dim MailDoc As Object
Dim AttachME As Object
Dim EmbedObj As Object
Set session = CreateObject("Lotus.NotesSession")
session.Initialize ("cantona")
UserName = session
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
'Open the mail database in notes
Set Maildb = session.GetDatabase("", MailDbName)
If Maildb.IsOpen = True Then
'Already open for mail
Else
Maildb.OPENMAIL 'Error Occurs Here
'
'Run time error '438':
'Object doesn't support this property or method
'