Mail Send Code, Need To Loop Through Multiple Servers



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
.



Relevant Pages

  • Expiry date for Demo Data Base
    ... also have a Autoexec Macro, but the code appears to be missing something, as ... Option Compare Database ... Dim rs As DAO.Recordset ... On Error GoTo Err_ProcedureName ...
    (microsoft.public.access.security)
  • RE: Copy table from open database to a closed database
    ... On Error GoTo err_handler ... Utter Access VIP ... Dim strSQL As String ... table to the other database. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Database operation
    ... On Error GoTo 0 ... Sub copy_6_Values_PasteSpecial ... "Oldjay" wrote: ... Is there a macro that will copy the record to the database and have it ...
    (microsoft.public.excel.programming)
  • Error Logic Suggestions Needed
    ... I used to use an "on error goto" ... at the top of the old VB 6 programs but, when reading about error logic for ... accesses a database and a spreadsheet literally 100's of times. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: database back up
    ... What I want to do is have the access database back its self up so if someone ... accesses the File Maintenance form then I get the message. ... On Error GoTo cmdbackup_Click_Error ... BackupDatabase 'Backs up the database ...
    (microsoft.public.access.modulesdaovba)