Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

sendobject error 2295

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bolo - 11 Jan 2008 18:48 GMT
I have a small app that distributes notification emails to different users
based on 2 criteria selected by the user.  I select the receipients based on
the input values they indicate. The distribution lists are static strings
from another file that I use... This approach has been working well with
single quote enclosed email address separated with a trailing ; i.e.   'a
user1'; 'a user2';  I assign the appropriate string(s) to a local variable
that I use as the sendobject TO and CC parameters.
I have confirmed every email address used in the strings are valid.

I now receive a 2295 error " Unknown message recipient(s); the message was
not sent." error.. anytime i execute the sendobject... I have tried building
the static strings with single quote, without single quote, and even with
only single receipient that I KNOW is valid, but still get the same error.
Pulling out what little hair I have left..  Suggestions??
Dirk Goldgar - 11 Jan 2008 18:52 GMT
>I have a small app that distributes notification emails to different users
> based on 2 criteria selected by the user.  I select the receipients based
[quoted text clipped - 12 lines]
> only single receipient that I KNOW is valid, but still get the same error.
> Pulling out what little hair I have left..  Suggestions??

Did you change the code in some way from what was working to what is now not
working?  If not, has anything else changed about your system?

You'd better post the code that builds the address string and calls
SendObject.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

bolo - 11 Jan 2008 19:39 GMT
OK, here it is, such as it is....
There are 4 teams of folks that may or may not be notified of a specific
event.. plus there is some special handling hard coded for some specific
events.
the single quote method has worked well thus far..
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Private Sub email_si_Click()
DoCmd.SetWarnings False
On Error GoTo com147err
Dim SI_Subject As String
Dim SI_Message As String
Dim SI_To As String
Dim SI_CC As String
Dim SI_BCC As String
Dim SI_SrMgr As String
Dim SI_SrMgrAlways As String
Dim TempSub As String
Dim TempKey As String

Dim strR1 As String
Dim strETDFail As String

Me.Refresh

' etd failures
strETDFail = "'xxxxxxxxxxxxx1; 'xxxxxxxxxxxxxx2; 'xxxxxxxxxxxxx3;
'xxxxxxxxxxxxx4;
'R1 Rules Violation Issues - entire subdivision
strR1 = "'xxxxxxxxxxxxxxxx5; 'xxxxxxxxxxxxxxxx6;"

'****** SI_To = "'xxxxxxxxxx7'; 'xxxxxxxxxxxxx8'; 'xxxxxxxxxxxx9';"

' ******* SI_BCC = "'xxxxxxxxxxxxxxx9';"
SI_CC = " "
' ****** If Me.SIPage = True Then SI_To = SI_To & "'xxxxxxxxxxxx10';
'xxxxxxx11';"
If Me.OPRPage = True And Len(OPREmail) > 1 Then SI_To = SI_To & Me.OPREmail
If Me.MOWPage = True And Len(MOWEmail) > 1 Then SI_To = SI_To & Me.MOWEmail
If Me.MECHPage = True And Len(MECHEmail) > 1 Then SI_CC = SI_CC & Me.MECHEmail
If Me.SIGPage = True And Len(SIGPage) > 1 Then SI_CC = SI_CC & Me.SIGEmail
If Me.SRMGRPage = True And Len(SRMGRPage) > 1 Then SI_CC = SI_CC &
Me.SRMGREmail
If Me.ETDPage = True Then SI_CC = SI_CC & strETD

'special handling for selected types of SI
If Me.OOFPage = True Then SI_CC = SI_CC & " 'xxxxxxxxxxx12';"
If Me.ETDPage = True Then SI_CC = SI_CC & strETDFail
If Me.RULESPage = True Then SI_CC = SI_CC & strR1

' setup to send message
If Len(Me.[SI Update Comments]) > 1 Or Me.[Has Updated] = True Then
SI_Subject = "UPDATE "

If [SI Page] = True Then SI_Subject = SI_Subject & "PAGE: "
SI_Subject = SI_Subject & "KC ROC SI: " & [SI Type] & " " & [SI Subdivision]
& " Subdiv"

SI_Message = Format([SI Start Time], "hh:nn") & " " & [SI Type] & " " &
UCase([SI Subdivision]) & " Sub At " & UCase([SI Location]) & " "
'put updated comments at top of message
If Len(Me.[SI Update Comments]) > 1 Then
 SI_Message = SI_Message & Chr(10) & "UPDATED INFO: " &
Me.SI_Update_Comments & Chr(10) & Chr(10)
 [Has Updated] = True
 [Updated Time] = Now()
End If
SI_Message = SI_Message & "SI DESCRIPTION " & UCase([SI Event Description])
& Chr(10) & "COMMENTS: " & Me.[SI Comments]

DoCmd.SendObject , , , SI_To, SI_CC, SI_BCC, SI_Subject, SI_Message
[Has Emailed] = True
[Emailed Time] = Now()
Me.Refresh

Exit Sub
com147err:
Debug.Print Now()
Debug.Print err.Number
Debug.Print err.Description
Debug.Print SI_Subject
Debug.Print "TO " & SI_To
Debug.Print "CC " & SI_CC

'pause
'Stop
Exit Sub
End Sub
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is the debug print from the last execution....
1/11/2008 13:26:02
2295
Unknown message recipient(s); the message was not sent.
PAGE: KC ROC SI: **xxxxxxxxxxxxxx
TO 'OPR DL KCDAS'
CC  
xxxxxxxxxxxxx
I know the TO recipient is a valid internal email name. .. I get the same
error if I remove the single quotes.
Believe it or not, we are running Windows XP Professional 2002  SERVICE PACK
1,
the company where I work has not yet approved SP2 for installation on our
workstations.....
Thanks

> >I have a small app that distributes notification emails to different users
> > based on 2 criteria selected by the user.  I select the receipients based
[quoted text clipped - 18 lines]
> You'd better post the code that builds the address string and calls
> SendObject.
Dirk Goldgar - 11 Jan 2008 20:33 GMT
> OK, here it is, such as it is....
> There are 4 teams of folks that may or may not be notified of a specific
[quoted text clipped - 104 lines]
> the company where I work has not yet approved SP2 for installation on our
> workstations.....

Hmm, with everything you have masked out above, I can't tell whether the few
mistakes I see exist in the original.  For example, you posted this:

> strR1 = "'xxxxxxxxxxxxxxxx5; 'xxxxxxxxxxxxxxxx6;"

But that's not valid, because you have a problem with the single-quotes.
The value of strR1 would be:

   'xxxxxxxxxxxxxxxx5; 'xxxxxxxxxxxxxxxx6;

when it should be:

   'xxxxxxxxxxxxxxxx5'; 'xxxxxxxxxxxxxxxx6';

In the test case you posted, was the message being sent *only* to "OPR DL
KCDAS"?  I'm not sure whether you should expect 'OPR DL KCDAS' (in the
single-quotes) to be recognized or not.  If, using Windows Mail, I send a
message to 'Dirk Goldgar' (in the single-quotes), it doesn't find the
contact entry that matches that name.  But if I take it out of the
single-quotes, it does.  I do recognize that you said you get the same error
if you remove the single-quotes, so I'm only speculating here.

If you make such a message manually, and enter the recipient as built above,
can the address be resolved?

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

bolo - 11 Jan 2008 20:46 GMT
> > OK, here it is, such as it is....
> > There are 4 teams of folks that may or may not be notified of a specific
[quoted text clipped - 129 lines]
> If you make such a message manually, and enter the recipient as built above,
> can the address be resolved?

Sorry, I blanked out the names for obvious reasons and went a space too
far.. the hardcoded names are correct...  
On the test case, yes, OPR DL KCDAS is the only receipient i was expecting
(i removed all else to simplify the test..  The current system being used
works fine with the single quote delimited names.. (I am working on a copy
..fortunately) Somewhere they get stripped off because when the outlook
version comes up for them to edit/send, the single quotes are gone.   I have
copied the names directly from the debug.print log to outlook and they
resolve fine.
Dirk Goldgar - 11 Jan 2008 20:59 GMT
> Sorry, I blanked out the names for obvious reasons and went a space too
> far.. the hardcoded names are correct...

That's what I figured, but of course I can't verify anything with regard to
the hard-coding of the addresses.

> On the test case, yes, OPR DL KCDAS is the only receipient i was expecting
> (i removed all else to simplify the test..  The current system being used
[quoted text clipped - 4 lines]
> copied the names directly from the debug.print log to outlook and they
> resolve fine.

So there's a current, production version of this application that is still
working properly?  Does that version work correctly on the PC where you're
running the development version taht is failing?  If not, then it must be
something about your system.  If so, you need to focus on what is different
between the two versions.  Beyond that, I'm afraid I have much to
contribute.  I'm not seeing anything wrong in your code (except what looks
to have been introduced by your obfuscation), nor in debug results.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

bolo - 11 Jan 2008 21:15 GMT
> So there's a current, production version of this application that is still
> working properly?  Does that version work correctly on the PC where you're
[quoted text clipped - 3 lines]
> contribute.  I'm not seeing anything wrong in your code (except what looks
> to have been introduced by your obfuscation), nor in debug results.

Thanks for your help and quick responses
bolo - 11 Jan 2008 22:21 GMT
Well, you are not going to believe the cause of my problem..  
When I built the email strings to populate my distribution lists, i
concatenated the end of each name with a & "'; "...  it appears that the
space is the culprit.. I removed the space and changed the concatenation to &
"';"...  it now again works perfectly with the single quotes on each name on
the input side of the sendobject which disappear on the outlook side..  I
dont know why.. It's friday and it works, so thats the end of my problem.  
Thanks again for your help.
Dale Fye - 11 Jan 2008 19:00 GMT
Are you saying that you are building a strTo and strCC so that when you do a
debug.print strTo it looks like:

asd.asd@xyz.com; abc.def@zyz.com; jkl.ghi@msn.com
or
'asd.asd@xyz.com'; 'abc.def@zyz.com'; 'jkl.ghi@msn.com'
or
"asd.asd@xyz.com"; "abc.def@zyz.com"; "jkl.ghi@msn.com"

I would think that the first option above would work, but not the other two.

HTH
Dale

Signature

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> I have a small app that distributes notification emails to different users
> based on 2 criteria selected by the user.  I select the receipients based on
[quoted text clipped - 10 lines]
> only single receipient that I KNOW is valid, but still get the same error.
> Pulling out what little hair I have left..  Suggestions??
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.