• Email Sender Name (Access 97/2K)

    Author
    Topic
    #370005

    Is there a way to send email based on an event that uses something like Database Administrator in the from line instead of the name of the person currently logged onto the machine?

    TIA

    Viewing 0 reply threads
    Author
    Replies
    • #584180

      How are you sending the email in the first place? If you’re using Outlook and not using SendObject, you can send mail from a different profile but you can’t make up a From address out of nowhere.

      • #584235

        Thank you Charlotte!

        Not being able to generate a FROM address out of nowhere answers part of the question.

        I am using Outlook and not SendObject. The database will reside on a common server with different people making changes to different forms. When changes happen to significant data, supervisors will be notified so they may take appropriate action. I do not want the email to come from a particular person but rather the “database” itself. i.e. from the Database Administrator not Kirk Lavender.

        Would the different profile need to be placed in each user’s Outlook? How would I use the different profile through VBA?

        • #584266

          Hi,
          Are you using Exchange Server? If so, then I think you need to create a new mailbox for Database Administrator and give SendOnBehalfOf permission for that mailbox to the users of your database. Your code will need to use the Namespace.CreateRecipient and the GetSharedDefaultFolder methods to reference the inbox for the Database Administrator and then send mail from there.
          Hope that helps.

        • #584291

          I believe a Lounge Search on CreateNamespace will turn up previous discussions on how to accomplish this.

          • #1030179

            Hi Charlotte,
            I didn’t find any posts under CreateNamespace and the other post I looked for no longer exists. I have access to a public e-mail box and am hoping there’s a simple way in Access 2003 to send my Access generated e-mail from my public e-mail box (FieldControls2@AnyCorp.com) as opposed to my personal folder. Any other direction would be appreciated.
            Thanks!!

            • #1030184

              You’ll find some examples of how to specify SentOnBehalfOfName in post 508,731 and post 365,631. This will still send the mail from the profile under which you’re currently logged in to Outlook, but with something like “Dashiell on behalf of DBAdmin” in the From box. If you want to send from DBAdmin, look up the Login method of the NameSpace object in the Outlook VBA help. Here is an example from the help subject:

              Set myOlApp = CreateObject(“Outlook.Application”)
              Set myNameSpace = myOlApp.GetNameSpace(“MAPI”)
              myNameSpace.Logon “myProfile”, “myPassword”, True, True

            • #1030193

              Thanks Hans. The reason I thought it would work by defining the “From” is because that is what I do in Outlook when I send e-mails from the public folder I created. I set the “From” to visible and then select the mailbox I set-up and when the receipient receives the e-mail, it states it’s from my folder and not from me or from my behalf.
              As always, thanks a bunch!!
              Andrew

    Viewing 0 reply threads
    Reply To: Email Sender Name (Access 97/2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: