Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sendobject Fail

Posted on 2009-03-31
11
Medium Priority
?
714 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
  • 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

972 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