Results 1 to 5 of 5
  1. #1
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72

    Error on SendObject method - Unknown recipient

    I ran into this error message with the SendObject method. I'm getting the email address from the "username" environment variable. Our company generally uses the logon ID as the first part of everyone's email address, but there are some users that get this error: "Unknown message recipient; the message was not sent" Not only that, if two sendobjects are used one after the other, sometimes it sends to the first person and then the second one is set up to send a copy back to the sending user, it doesn't recognize the recipient that's logged on and is actually trying to send the email. That's the one that comes from the environment variable. But I've tried hard-coding the recipient and bypassing the variable altogether and it still generates the same error. Can anyone please help with this problem? Thanks in advance.


    Glenn

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    post your code please.

    Have you tried putting in some debug.print statements before you send the email so you can see what is actually going on?

    for instance let's say you're using the strings sfrom and sto to be your from and to lines and you have code like

    sfrom = environ("username") & "@someemaildomain.com"
    st = "something else" & "@someemaildomain.com"

    before you issue the sendobject command put in

    debug.print sfrom
    debug.print sto

    and see what email address is actually being generated

  3. #3
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72
    I did put in the equivalent of a Debug.Print statement. I used a MsgBox to display the contents of the variables. They showed up correct and then I hard-coded the user ID into the SendObject line so there could be no mistake about it. I wound up adding the domain (@SomeDomain.com) to the recipient data and that appears to have fixed the problem. However, in the past the user ID alone was sufficient for the recipient so I don't understand what may have changed (in Access or Outlook). Thanks for your response.
    Glenn

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    what you're experiencing I think has to do with how outlook resolves the username into an actual email address which is controlled by your email server. Has any of your email setup changed since this stopped working? if it's working it may not be worth trying to find the problem but we can try if it's important.

  5. #5
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72
    Now that it's working with the domain name, I think I'll leave it that way. I thought it might have been something that happened along with the Office upgrade but I think this fix is working so I should probably focus on other things that may need attention. Thanks again for your help.
    Glenn

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

Similar Threads

  1. Outlook error message using SendObject method
    By Juan23 in forum Programming
    Replies: 3
    Last Post: 07-10-2013, 12:03 PM
  2. Unknown syntax error. Any spare eyes out there?
    By redbull in forum Programming
    Replies: 3
    Last Post: 08-31-2012, 11:55 AM
  3. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  4. Replies: 7
    Last Post: 01-26-2011, 08:31 PM
  5. Unknown Error
    By pimlicosnail in forum Forms
    Replies: 1
    Last Post: 02-26-2010, 10:19 AM

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