Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error 2295:  Unknown message recipients

Posted on 2006-11-30
9
Medium Priority
?
855 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

971 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