Solved

Sendobject Fail

Posted on 2009-03-31
11
695 Views
Last Modified: 2012-05-06
I have set up a function for my client to emal information directly out of their MS Access application.  I am using the SendObject command as shown in the code window.

To initiate this process the user must first enter an email address on the form in my application, then click the 'email' button that I put there.  The emails are only sent successfully if the entered email address exists in the users MS Outlook address book.

If the email address is not in the users MS Outlook address book an error comes up and the email is not sent.  Unfortunately I didn't write the error down but the message is something about could not validate email address in address book.

Alot of these emails are one time shots and the user doesn't want to clutter his address book with them or take the time and extra steps to put them in the address book.

How can I get around this issue?
DoCmd.SendObject acSendReport, _
                 "rptEmailsSent", _
                 acFormatRTF, _
                 eMailTo, _
                 eMailCC, _
                 eMailBCC, _
                 eMailSubject, _
                 eMailBody, _
                 False

Open in new window

0
Comment
Question by:mlcktmguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 28

Expert Comment

by:TextReport
ID: 24033274
If the email addresses are in the form of UserName@DomainName.Com or the like they should work, if the are John Smith then it would have to be resolved to the Address book.
Cheers, Andrew
0
 
LVL 1

Author Comment

by:mlcktmguy
ID: 24033739
The user is entering a valid emal address in the form of UserName@DomainName.Com.
0
 
LVL 28

Expert Comment

by:TextReport
ID: 24033787
Are the variables eMailTo, eMailCC and eMailBCC all defined as strings?
What version of Outlook are you using?
Cheers, Andrew
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:mlcktmguy
ID: 24034544
Yes, all defined as strings.  They are using Outlook 2007.

The emails are sent as long as the address the user types in is also in the address book.

0
 
LVL 28

Expert Comment

by:TextReport
ID: 24036831
"The emails are sent as long as the address the user types in is also in the address book." I can not see anything that would force the either in Access or Outlook. I am using Access 2007 and Outlook 2007 and sending emails all the time without a problem to unlisted addresses but I do not use SendObject I use MAPI code.

Can the user create an email and send it to an address not in the addressbook manually?
Are you using an Exchange Server?
I suspect it is to do with the security features to stop viruses.

Cheers, Andrew
0
 
LVL 28

Expert Comment

by:TextReport
ID: 24036852
I have just tried to use the SendObject in Access 2007 through Outlook 2007 and it advises me that a program is trying to send an email, do I want to allow it. This happens if the email address is in the address book or not.
Cheers, Andrew
0
 
LVL 1

Author Comment

by:mlcktmguy
ID: 24038204
Yes they also get the message asking to allow the email and they respond correctly.

From that point on is where the difference is, and the error is thrown based on whether the entered address is in the address book or not.
0
 
LVL 28

Assisted Solution

by:TextReport
TextReport earned 250 total points
ID: 24038394
I hardly ever use the SendObject command and I normally send emails through code that I have had / updated through many versions of Access. If you are interested then I can paste a copy of the code for you.
Cheers, Andrew
0
 
LVL 1

Author Comment

by:mlcktmguy
ID: 24098373
Finally got the specific error message that the client is getting: 2295
0
 
LVL 28

Expert Comment

by:TextReport
ID: 24099830
Can you advise the error message as well as the error number.
Cheers, Andrew
0
 
LVL 1

Accepted Solution

by:
mlcktmguy earned 0 total points
ID: 24204384
They didn't supply the message however, I searched the error number on EE and came up with "Error 2295:  Unknown message recipients".

For the time being I have put a trap in the code for that specific error number.  If it occurs I show the user a message and continue on without sending the email.

Prior to this my generic error trapping was cancelling execution and kicking them out of the system.

It didn't resolve the specifc issue but handles it much more gracefully when the error does occur.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question