Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17

    SendObject rejects some e-mail names

    I'm using DoCmd.SendObject to send an e-mail using Windows Live Mail.
    Works great UNLESS the recipient name contains a "_" character as in
    joe_blow@isp.com. joeblow@isp.com works just fine.

    I get RT Error 2293 "Access can't send this e-mail message"

    Is this a WLM problem? SendObject problem? VBA? my code?

    Are there character restrictions for the e-mail name? If so that is bad
    because these are valid names for users. What am I doing wrong and how
    do I correct the syntax so that these e-mail names can be accepted?



    WIN 7, Access 2010

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Post the code for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    This is the code in test mode. Actual code uses a variable for the "To" parameter and text variables for the message body, but it fails (RTE 2293) whether a variable or hard wired as in this example. Remove the "_" in the recipient's name and it works just fine.

    DoCmd.SendObject acSendNoObject, , , "joe_blow@isp.com", , , "Mail Subject", "Message text sent as e-mail to recipient", False

    dick

  4. #4
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    As additional information on this problem:

    The mail application (WLM in this case) issues the security warning message about allowing a program to send an e-mail. The name of the recipient is shown as joe_blow@isp.com and after I click SEND it is then that it returns to Access and gets the RTE 2293 error. It would appear that WLM is returning a condition to Access that causes the problem. But what is it complaining about?

    dick

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Sorry, I am lost on this one. I don't even understand how you can email via Windows Live with VBA. I thought had to be through Outlook.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    I would assume that Access has no idea what the "name" of the mail application is and asks Windows for the default SMTP (or is it MAPI?) application and uses that interface. I'm using all Windows products for this and have not heard of any restrictions. Are you suggesting that this would work with Outlook? If it did then there is a problem with WLM? Anyone (else) out there have an idea about what is wrong and how to get around it? I do have MS Office so could install Outlook to try it but would rather not. WLM is fine for all that I do except for this glitch.

    If I run the SendObject code and the mail application is not running then Access (or Windows?) starts the application, performs the SEND and then closes the application (in this case WLM).

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    I don't know if Outlook would have issue with the underscore. You could test it.

    The only other thing I can suggest is error handler code. You could have the code resume after any error or go to error handler code that will check the error number and if 2293, resume, else exit.

    Review http://www.cpearson.com/excel/ErrorHandling.htm
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    Doing some more detective work and have discovered that it is NOT due to the "_" character in the name. Apparently the recipient's name must be in the Contact list and the primary e-mail address must match the recipient's name. Any other e-mail name that may be associated with user is not checked.

    So now my question is: Is there a way to get the message out WITHOUT the e-mail application checking the contacts list? I'll have to look at the security options in WLM. I have already unchecked the option to "ask for permission" when an application is trying to send an e-mail internally. Maybe there is an
    option to not check the Contacts?

    Failing that then I'll have to see if there is a way to add the user as a contact to WLM before sending an e-mail. What a pain that would be. Will keep you posted.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    I use VBA to send email via Outlook to addressee not in my contacts and not even in my organization (such as to my personal email when I do tests).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    Right. According to various forums I have checked the WLM will always check the contact list. There is no way to bypass this. But Outlook does have this option. So, I will install Outlook and see what happens when I use that as the mail handler. Did you have to turn off CheckNames in Outlook?

    I too am using this code on my personal laptop for testing purposes and discovered this problem accidentally. I originally hard coded my e-mail address as dicklast@isp.net and it went. Then added logic to get e-mail address from the customer record. There my e-mail name is dick_last@isp.net and it failed!!
    (I have both names as an alias in my ISP so either one will do). But WLM is running the name through the Contacts and only likes the one that is the Primary e-mail address. If I change that then it works for that e-mail address.

    Will let you know what happens next.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    I don't remember ever setting a CheckNames parameter in Outlook. Also not dealing with any aliases. My automated email works at office but last attempt to test from home computer failed. Keeps telling me Outlook not set up when I know it is.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    Just finished installing Outlook, Now trying to figure out how to copy my WLM contact list to OutLook. Not obvious. Grrrrrr.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Might have to export to csv file and then import to Outlook.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17
    Done. Have to take a break now. Back later to try this all over again, Having trouble getting used to the newer look of OutLook compared to WLM!!

  15. #15
    dick is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    17

    Smile

    Bingo!! Using OutLook (with no particular settings) I can send e-mail using VBA code (SendObject) to any e-mail name of the format userid@isp.com whether that name is in my contact list or not.

    When using WLM and typing an e-mail address directly in the "To" box there is no rejection from Check Names. This appears to only happen when using the application interface such as with VBA code. Is this a bug or a feature? Is there anyone in MS WLM-land that would listen and respond to this?

    I don't think that other security options are interfering (McAfee, Windows) with the SendObject function otherwise OutLook would have seen the same rejection.

    Thanks for your feed-back.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Leveraging SendObject and default local mail client
    By chris.williams in forum Programming
    Replies: 0
    Last Post: 12-08-2011, 04:42 PM
  2. Replies: 11
    Last Post: 09-12-2011, 11:30 AM
  3. Query Entity Names, and Column Names
    By Accidental DBA in forum Queries
    Replies: 1
    Last Post: 07-22-2011, 02:38 PM
  4. Replies: 5
    Last Post: 04-24-2011, 03:14 AM
  5. SendObject
    By weshader in forum Access
    Replies: 1
    Last Post: 11-09-2009, 04:19 PM

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