• Lotus Notes and MS Access

    By Darren Abels 2 decades ago

    I am working on an auto notification database which queries my time tracking database and makes sure associates enter 8 yours a day into the time tracking database.



    I have the auto notification database working but all e-mails are sent from my Lotus Notes account meaning when a user recieves an auto notify message it is from me. What I would like to occur is have the message be from their manager.



    In the database I have all the user's Lotus Notes passwords, server names and .nsf files. This is all I needed to send an e-mail using my information.



    My question is, can I initiate the sending of an e-mail using someone else's Lotus Notes information. Example, if Bill did not enter his time and Bill's manager is Jim, I would like a reminder auto notification e-mail to come from Jim (Bill's manager), not me.



    Here is the code I have. Any help would be greatly appreciated.



    Dim session As NotesSession

    Dim MailDb As NotesDatabase

    Dim MailDoc As NotesDocument



    Set session = CreateObject("Lotus.NotesSession")



    Call session.Initialize("My Lotus Notes Password")



    Set MailDb = session.GetDatabase(ServerName, MailFile.nsf)



    If MailDb.IsOpen = True Then

    'Already open for mail<br/>
    

    Else

    Call MailDb.Open<br/>
    

    End If



    Set MailDoc = MailDb.CreateDocument



    Call MailDoc.ReplaceItemValue("SendTo", SendTo)

    Call MailDoc.ReplaceItemValue("BlindCopyTo", "My e-mail address")

    Call MailDoc.ReplaceItemValue("Subject", "Time Tracking Notification for " & Date - checkDaysBackAmount & " to " & Date)

    Call MailDoc.ReplaceItemValue("Body", Body of Message)



    MailDoc.SaveMessageOnSend = True



    Call MailDoc.Send(False)



    Set MailDb = Nothing

    Set MailDoc = Nothing

    Set session = Nothing



    Thanks

    Darren

    • I don't think you can do what you want

      By Danny Lawrence 2 decades ago

      The "From" in a mail sending agent is the person who signed the agent. You aren't going to be able to vary the sender. I think your best option is to sign the agent with the server's ID (thus the message will come from the server) or create an "Agent Signer" ID and sign the agent with that.

      • By Darren Abels 2 decades ago

        Thank you very much for the response. I am just learning how to code Access to interact with Lotus Notes so could you explain a little more about how I could sign the agent with the Server's ID? I assume this means that my name would appear like on the e-mail but then who would the e-mail show it was from in each person's inbox? Also, any code examples would be very helpful.



        Thanks again.

        Darren

    • E-Mail Notification

      By Joerg Reck 2 decades ago

      Hello,



      a possible solution is to create a Time-Tracking-ID, which is used fpr sending the eMail and also replace the Value of the Principal-Field with the notes name of the manager.



      In the Mail will appear

      From -> Manager

      Send by -> Time-Tracking-ID



      Greetings and merry christmas

      JJR

    • MailDoc.principal

      By Ed Maloney 2 decades ago

      Try MailDoc.principal = variable containing manager name.

      This should set the From: field to the manager name.

      Or check Agent FAQ at www.lotus.com/ldd/46dom.nsf

      HTH,

      Ed