Solved

Error 2295:  Unknown message recipients

Posted on 2006-11-30
9
731 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
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…

785 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