• Email message from Access (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Email message from Access (Access 2000)

    Author
    Topic
    #427274

    My form has a lable which contains an email hyperlink address. When I click on the label, the default email program will open with the address and subject, and the user needs to add in whatever message before sending. The code for the hyperlinked label is as follows:

    Private Sub lblEmail_Click()
    lblEmail.HyperlinkAddress = “mailto:?subject=
    End Sub

    It works fine so far. Now I also want to add a pre-determined short message into the body of the email where the hyperlink is clicked.

    Can I do that in Access?

    PS: Perhaps the alternative is sending the message as an attachment. How can it be done?

    Viewing 1 reply thread
    Author
    Replies
    • #989621

      I found the solution after searching the internet. I changed my label into a command button, and add in the code

      DoCmd.SendObject acSendNoObject, , , strEmailAddr, , , strSubject, strMsgBody, True

      The boolean parameter True is to enable user to edit the email message. Take note of the parameters which are left blank. The solution may be helpful for anyone who may have the same problem as me.

    • #989622

      You already found a different method. It is also possible to use the HyperlinkAddress:

      lblEmail.HyperlinkAddress = “mailto:?subject=&body=”

      • #989627

        Using HyperlinkAddress is simpler but it has one caveat : the message text is in a single paragraph only; whereas by using docmd.SendObject, I can add vbCr in my message text to break it into several paragraphs.

    Viewing 1 reply thread
    Reply To: Email message from Access (Access 2000)

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

    Your information: