Index: openacs-4/packages/imsld/tcl/imsld-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.xql,v
diff -u -r1.33 -r1.34
--- openacs-4/packages/imsld/tcl/imsld-procs.xql	24 Oct 2006 10:09:51 -0000	1.33
+++ openacs-4/packages/imsld/tcl/imsld-procs.xql	30 Oct 2006 12:14:34 -0000	1.34
@@ -1136,7 +1136,7 @@
 		<querytext>
 
                 select sm.title as send_mail_title, ar.object_id_two as sendmail_id
-                from imsld_send_mail_servicesi sm
+                from imsld_send_mail_servicesi sm, acs_rels ar
                 where sm.service_id = :service_item_id
                 and sm.item_id = ar.object_id_one
                 and ar.rel_type = 'imsld_send_mail_serv_data_rel'
Index: openacs-4/packages/imsld/www/imsld-sendmail.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-sendmail.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/imsld/www/imsld-sendmail.xql	18 May 2006 11:13:01 -0000	1.1
+++ openacs-4/packages/imsld/www/imsld-sendmail.xql	30 Oct 2006 12:14:35 -0000	1.2
@@ -3,16 +3,17 @@
 
 	<fullquery name="get_all_email_data">
 		<querytext>
-
-        select iri.title,
-               iri.role_id as group_recipient,
-               isms.recipients 
-        from imsld_send_mail_data ismd,
-             imsld_send_mail_servicesi isms, 
-             imsld_rolesi iri 
-        where ismd.send_mail_id=isms.item_id 
-              and iri.item_id=ismd.role_id
-              and isms.mail_id=:send_mail_id
+		select iri.title,
+		       iri.role_id as group_recipient,
+		       isms.recipients 
+                from imsld_send_mail_datai ismd, 
+		     acs_rels ar, 
+		     imsld_send_mail_servicesi isms,
+		     imsld_rolesi iri 
+		where ismd.item_id=:send_mail_id 
+		      and ar.object_id_two=ismd.item_id 
+		      and ar.object_id_one=isms.item_id 
+		      and iri.item_id=ismd.role_id
 		</querytext>
 	</fullquery>