Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bypassing Lotus Notes Password from VB

Status
Not open for further replies.

soflahe

Technical User
Jan 9, 2006
3
DE
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.

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
'
 
Check the following setting in your Notes client:

Select menu "FILE | SECURITY | USER SECURITY" and find the following item soemwhere in the dialogbox:

"Don't prompt for a password from other Notes based programs"

If it's not ticked it will always ask for a password. Normally, when ticked, it will not ask for a password <b>as long as the notes client is active</b>

Brgds,

TrooDOS
 
Thanks Troodos,

I checked the security partameters and I have the box ticked.

soflahe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top