Solved

Error 2295:  Unknown message recipients

Posted on 2006-11-30
9
706 Views
Last Modified: 2011-09-20
Hi All :)

I have a module that sends email to all users in a database for administrative purposes.  It uses network ID's and the exchange server resolves the addresses.  However, suddenly I'm getting the subject error, and it will not produce the email.  Is there a way to force this without having to use addresses?

Thanks!
~Jillyn
0
Comment
Question by:Jillyn_D
  • 5
  • 4
9 Comments
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18049666
Hey Jill,
you can actually link to your exchange server address list and do an Access internal lookup to the linked table to do your own name resolution. You could also query the names and e-mail addresses and create an Access table that you can modify to suit your needs. Can you paste in the code you're using now to send these mails?
0
 
LVL 8

Author Comment

by:Jillyn_D
ID: 18078831
Hi Jeff :)

Sorry about the delay on this!  I completely forgot about it over the weekend.

Linking to the address book doesn't work very well because we have about 200,000 people in our GAL...Makes things very slow!  I can't use my personal address book because most of my users are not in it, and my user group is far from static.

The object here is to send out notifications to my test group for an application when a new test version is available.  However, I user similar procedures for notification in a lot of applications.


This is the generic version:

Public Sub eMailUsers()
Dim rs As Recordset
Dim lngLim As Long, lngCnt As Long
Dim strCC As String, strTo As String, strSub As String, strMsg As String
    Set rs = CurrentDb.OpenRecordset("tblUsers")
    rs.MoveLast
    lngLim = rs.RecordCount
    For lngCnt = 1 To lngLim
        If lngCnt <> 1 Then
            rs.MoveNext
        Else
            rs.MoveFirst
        End If
        If rs!Group = "Admin" Then
            strCC = strCC & rs!UserID & "; "
        Else
            strTo = strTo & rs!UserID & "; "
        End If
    Next
   
    strSub = InputBox("Please enter subject")
    strMsg = InputBox("Please enter message")
   
    DoCmd.SendObject , , , strTo, strCC, , strSub, strMsg, True
   
End Sub
0
 
LVL 8

Author Comment

by:Jillyn_D
ID: 18078864
BTW, thanks for responding to my ?

:)
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18079079
Hey Jilly,
Exchange resolves this ok...with network ids..given that there is an alias defined in the address table. Has there been some kind of recent change to your e-mail system? Is it your intention to go ahead and let it choke on one or two but continue to send the rest?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 8

Author Comment

by:Jillyn_D
ID: 18079390
jefftwilley,

Honestly, I wouldn't care if it choked on all of them in this instance.  However, the network IDs are the GAL alias and uniquely identify the users, so there should be no hiccups there.  The problem is that Access won't even generate the email.  It gives me the unknown recipients message and stops.

As for the email system...IT is always making changes, but I am not aware of anything specific with exchange recently.

~Jillyn
0
 
LVL 34

Accepted Solution

by:
jefftwilley earned 500 total points
ID: 18079508
Your code works elsewhere...right? The only thing I see that may be an issue is you probably need to trim the ; at the end of the strTo and strCC .

Try a quick swap and see if it makes a diff

Public Sub eMailUsers()
Dim rs As DAO.Recordset
Dim strCC As String, strTo As String, strSub As String, strMsg As String
    Set rs = CurrentDb.OpenRecordset("tblUsers")
    If rs.EOF Then
        MsgBox " No Records Pulled"
        Exit Sub
    End If
    rs.MoveFirst
    Do Until rs.EOF
        If Nz(rs!Group) = "Admin" Then
            strCC = strCC & Nz(rs!UserID) & "; "
        Else
            strTo = strTo & Nz(rs!UserID) & "; "
        End If
    rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing
    'deal with nulls and ending odd characters here
    strTo = Left(strTo, Len(strTo) - 1) & ""
    strCC = Left(strCC, Len(strCC) - 1) & ""
    strSub = InputBox("Please enter subject") & ""
    strMsg = InputBox("Please enter message") & ""
   
    DoCmd.SendObject , , , strTo, strCC, , strSub, strMsg, True
End Sub
0
 
LVL 8

Author Comment

by:Jillyn_D
ID: 18079549
*laughs* AMAZING!

As always, your brilliance is blinding :)  Thanks, Jeff!
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18079568
Most welcome. Have a great day!
J
0
 
LVL 8

Author Comment

by:Jillyn_D
ID: 18079583
Thanks!  You too!
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
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…

758 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

21 Experts available now in Live!

Get 1:1 Help Now