Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Lexington Park, Maryland, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problems sending 2 Emails with Docmd.Sendobject (Access 2000)

    I am trying to send 2 consecutive emails using the following code. I have a button that gets pressed and an email gets sent to the user using the database and then one to the administrator, me in this case. When the button is pressed it sends the first email fine. The second is never sent. When I comment out the first email line, the second works fine.

    Also, there is another problem with these 2 lines of code. When the form loads and the button is pressed for the first time, it sends only the first email. When the button is pressed a second, third, etc time, no emails are sent. I then am forced to shut Access all the way down to get the email function to work again.


    DoCmd.SendObject acSendNoObject, , acFormatHTML, strAdmin, , , strSubjectNewUserPasswordAdmin, strMessageNewUserPasswordAdmin, False

    DoCmd.SendObject acSendNoObject, , acFormatHTML, strNameUser, , , strSubjectNewUserPasswordUser, strMessageNewUserPasswordUser, False

    Any assistance is welcomed.

    Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Problems sending 2 Emails with Docmd.Sendobject (Access 2000)

    Some things to try:
    <UL><LI>After sending the first e-mail, use Alt+Tab to see if there is a message box hidden behind the Access window waiting for input.
    <LI>See if the problem persists if you set the last argument (EditMessage) to True instead of False temporarily. You will have to click the Send button in the message manually.[/list]Due to security measures, sending e-mails programmatically is not as easy as it used to be. See <post#=317048>post 317048</post#> for some solutions; ClickYes is the simplest.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Lexington Park, Maryland, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problems sending 2 Emails with Docmd.Sendobject (Access 2000)

    None of those solutions worked. The solutions in post 317048 would not work for my situation. It does not matter. I figured out a way around this problem.

    Thanks anyway.
    Mike

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Problems sending 2 Emails with Docmd.Sendobject (Access 2000)

    For the benefit of others reading this thread, could you give an indication of your workaround? Thank you.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Lexington Park, Maryland, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problems sending 2 Emails with Docmd.Sendobject (Access 2000)

    The goal of those 2 lines of code was to send different messages to the User and to the Administrator. Instead of different messages, I reworded onw of the messages to make it appropriate to send to both the user and the administrator. I then used one docmd.sendobject like the following:

    DoCmd.SendObject acSendNoObject, , acFormatHTML, strEmailTo, , , strSubjectNewPasswordExistsUser, strMessageNewPasswordExistsUser, False

    where strEmailTo = UserEmail & "; " & AdministratorEmail

    Mike

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Problems sending 2 Emails with Docmd.Sendobject (Access 2000)

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •