Solved

Sendobject Fail

Posted on 2009-03-31
11
691 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

830 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