automation error

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi

I have set up an automation with Outlook and sending emails to our clients.
I am using Redemption to avoid the security dialogs.

The problem is when it sends around 373 email, an error will occur and
emails stopped. I tried to open other forms but an error msg pops up citing
not enough memory. (Other programs works properly). When I close Access and
reopen it operates normally and when I send emails again, it will stop again
at 373-5 emails.

I tried sending very much smaller sized emails e.g "just hello". (50 bytes).
It still creates the error after 373 emails. What could be wrong and how do
I overcome this issue. Help is appreciated.

Thanks in advance
Richard

Here's the code:

Set ola = CreateObject("Outlook.Application")
Set myNameSpace = ola.GetNamespace("MAPI")
Set qryResults = CurrentDb.OpenRecordset("QryEmailWithoutEmailRet")

a = 1

If qryResults.BOF Then GoTo ExitHere
Me.lblStatus.Caption = "Creating emails. Please wait..."
DoEvents

Set myFolder = myNameSpace.GetDefaultFolder(olFolderDrafts)
Set myItem = myFolder.Items

qryResults.MoveFirst

Do Until qryResults.EOF


Set myTempItem = CreateObject("Redemption.SafeMailItem")
Set FWDItem = myItem.Item(1).Forward

FWDItem.To = qryResults!EMAIL
FWDItem.Display
FWDItem.Close olSave
DoEvents
FWDItem.DeleteAfterSubmit = True
myTempItem.Item = FWDItem

myTempItem.Send
Me.LblStatus2.Caption = a & " emails sent"
DoEvents

FWDItem.Close olDiscard

Set myTempItem = Nothing
Set FWDItem = Nothing

a = a + 1
qryResults.MoveNext

Loop
 
I get a very similar problem.

When doing a 'mass' merge in outlook, it will throw errors after sending the
392'nd email!I have not found that this is effected by the size of the
email.

The specific error message i get is 'Cannot resolve Message Recipient'. I
checked and double checked the obvious cause, the email address it is
attempting to send too is valid.

I have also tried the following to get around ths issue, but to no avail.

1. Turned off automatic send/recieve. (i had originally thought that this
might have been a problem with a 100% cpu spike when doing both s/r and
adding emails to the queue at the same time.)

2. Changed the automation code to initalaize a close and open a new outlook
application after sending every email. This was slow, i had high hopes that
it would get past 392, but alas! it failed!

Does anyone know of any setting that might effect this?

Regards

John
 
Back
Top