Andy Lacey
andy at minstersystems.co.uk
Thu Mar 17 01:36:07 CST 2005
I'm not sure if this is it Darren but when I send a batch of emails I'd call this routine for each. In other words I'd be recreating (and Set'ing to Nothing) the Outlook and Redemption items each time. You could try that. Move the lines > Set omsg = gappOutlook.CreateItem(olMailItem) > Set msg = New Redemption.SafeMailItem > > msg.Item = omsg inside the loop. It might help. -- Andy Lacey http://www.minstersystems.co.uk > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK > Sent: 17 March 2005 05:23 > To: 'Access Developers discussion and problem solving' > Subject: [AccessD] A2003: Outlook not working using > redemption -DESPERATE > > > Hi all > 2nd Posting > I have now wasted a total of 6 and a half hours on this > It can't be that difficult - surely > > Can someone please help? > > Code below modified from my previous post > > I have references to Outlook 11 > I have references to Redemption > All that side of things is OK > I can send up to 2 emails before the code chokes > The email addresses are real, they work > > All I want this thing to do is > Create the message then send it - loop the recordset then > Create the message then send it - loop the recordset then... > > Simple <sigh> > > Many thanks > > Darren > > <Code> > Dim db As DAO.Database > Dim selSQL As String > Dim rs As DAO.Recordset > > Dim gappOutlook As New Outlook.Application > Dim omsg > Dim msg > > Set db = CurrentDb() > selSQL = "Select tmp_tblEmailAddresses.* from > tmp_tblEmailAddresses" Set rs = db.OpenRecordset(selSQL, > dbOpenSnapshot) > > Set omsg = gappOutlook.CreateItem(olMailItem) > Set msg = New Redemption.SafeMailItem > > msg.Item = omsg > > With rs > Do While Not .EOF > With msg > .To = rs!EmailAddress > .cc = Me.txtCC > .bcc = Me.txtBCC > .Subject = Me.txtSubject > .Attachments.Add Me.txtATTACH > .Body = Me.txtBody > '.Display ' shows it in the email client > before sending > .Send > End With > .MoveNext > Loop > End With > > </Code> > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > >