Mail Send Code, Need To Loop Through Multiple Servers

E

Erick C

Hi everybody!

I am hoping one of you experts out there can help me out. I have a bit of code right now that sends emails through Lotus Notes. It works fine, but if our primary mail server goes down and we run on the backup the code does not work. Currently we only have the primary server identified in the code"MAILS/CERT". If there is an error then it generates an error message later in the code.
I need to find a way to get the code to first try "MAILS/CERT", and if it cannot log in, then try "MAILS2/CERT". Unfortunately I am not experienced enough in VBA to figure out how to write the code to make it loop through these two myself. Any assistance I can get would be greatly appreciated. A protion of my code is below:

'startup Lotus notes and get object handle
Set s = CreateObject("Notes.notesSession")
server = "MAILS/CERT"
Database = "MAIL\fconfirm.nsf"
Set db = s.GetDatabase(server, Database)


On Error GoTo ErrorLogon
'see if user is logged on
Set doc = db.CreateDocument
On Error GoTo 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top