Results 1 to 5 of 5
  1. #1
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352

    Angry Email will no longer send. Run time error 2295. Unknown Recipients.


    I had a button on a report that worked perfectly and would generate an email with one recipient and one cc and a subject line. The recipients were manually programmed in (i.e. they were not part of any tables or queries) as "someone@domain" and it worked absolutely fine. Yesterday I split the database and created an accde front end and sent it out. Now today when I went to double check everything was still a-okay, I get a run time error telling me the message could not be sent; unknown recipients. I went back to the original copy of the database and got the same error message! It was working just fine for weeks and now it doesn't! Is this Access or perhaps my mail server??

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Are you using a Macro or Code behind your button? Maybe you can screenshot your macro or paste the code. Be careful not to share personal info.

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Here is the code behind the button
    Code:
    Private Sub btnSubmit_Click()
    DoCmd.SendObject acSendReport, , acFormatPDF, "Person1@domain.com", "Person2@domain.com", "Order Request", , True, False
    DoCmd.Close acReport, "gasketsRpt", acSaveNo
    DoCmd.Close acForm, "GasketsForm", acSaveNo
    End Sub
    I have many other forms and reports with the same function in this db and they all seem to be working fine, just this one is having issues...and I don't know why. Before it brings up the email I get a message about "a program is trying to send an email on your behalf" and I click allow and then I get the access error message. The other forms/reports do not give me either of these problems.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I do not know why, specifically, you are getting the runtime error. I suspect it has to do with your close Report and maybe the close form statements.

    First, your SendObject needs a little adjusting. The body of your email is getting a Constant as an argument. Perhaps it is best to send a String Literal.
    DoCmd.SendObject acSendReport, , acFormatPDF, "Person1@domain.com", "Person2@domain.com", "Order Request", , "This goes in the body.", False

    Then, you are telling access to do some things that are not available during runtime. You should not be using the Save argument. This is to save design changes and not for saving data in tables.
    DoCmd.Close acReport, "gasketsRpt", acSaveNo
    DoCmd.Close acForm, "GasketsForm", acSaveNo

    Also, why are you closing the report? Did it ever get opened? Probably leave that statement out, entirely.
    I would adjust it to this.
    DoCmd.Close acForm, "GasketsForm"

    If that still gives you issues, we can look at what is happening when the user is interacting with Outlook and if that is causing issues with the flow of statements.

  5. #5
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    The SendObject button is in the report and I just want the form and report to close out after the email is sent so that the user automatically returns to the switchboard. I will take out the save arguments. What do you mean when you put "This goes in the body." during the send object statement? Do you mean the message text of the email?

    I just re wrote the code and it works fine now, no idea what the problem was.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sending Email 2295 errormessage
    By Eef in forum Modules
    Replies: 1
    Last Post: 01-06-2015, 09:31 AM
  2. Send email to multiple recipients based on query
    By nablmm in forum Programming
    Replies: 3
    Last Post: 09-11-2014, 05:36 PM
  3. Send email error and double up address
    By burrina in forum Forms
    Replies: 6
    Last Post: 01-21-2013, 03:49 PM
  4. Replies: 2
    Last Post: 12-07-2011, 07:48 AM
  5. Error 429 when try to send email
    By sjoaccess in forum Access
    Replies: 1
    Last Post: 02-04-2011, 07:45 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums