sendobject error 2295


B

bolo

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??
 
Ad

Advertisements

D

Dirk Goldgar

bolo said:
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??


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.
 
D

Dale Fye

Are you saying that you are building a strTo and strCC so that when you do a
debug.print strTo it looks like:

(e-mail address removed); (e-mail address removed); (e-mail address removed)
or
'(e-mail address removed)'; '(e-mail address removed)'; '(e-mail address removed)'
or
"(e-mail address removed)"; "(e-mail address removed)"; "(e-mail address removed)"

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

HTH
Dale
 
B

bolo

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
 
D

Dirk Goldgar

bolo said:
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.....


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?
 
B

bolo

Dirk Goldgar said:
bolo said:
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.....


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?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
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.
 
Ad

Advertisements

D

Dirk Goldgar

bolo said:
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
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.

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.
 
B

bolo

Dirk Goldgar said:
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.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Well, I tried the production version on this machine and guess what...worked fine. I'll keep plodding along and see if something comes to light.. obfuscation is my speciality :)
Thanks for your help and quick responses
 
Ad

Advertisements

B

bolo

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top