Solved

Sendobject Fail

Posted on 2009-03-31
11
682 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now