Delayed Email Project

doran_doran

Registered User.
Local time
Today, 11:33
Joined
Aug 15, 2002
Messages
349
Hi,

Here is the MS Access database where I am trying to implement COM version of send mail.

1. http://www.southernselectbeer.com/database/FE-DV_QA_4 20MIN.zip
(try this http://www.southernselectbeer.com/database and download the zip file)

2. Go to "frmSearch"

3. Select "Search"

4. Select Ga_number and Put 43758 and select the first record 09/30/2003 and double click

5. This should load data into another form "frmGroup"

6. Click "Notes" on the top

7. Highlight any notes and click on "View Note"

8. on the bottom of the screen you will txtRecipients
start typing e-mail addresses (one e-mail address per line)
for example: 1st line moe@yahoo.com
2nd line raul@yahoo.com
3rd line gred@hotmail.com
Try it with atleast 3 to 4 mail address

9. Then click on "Send Mail"


Here is my question.

a. It's taking for ever (i mean 4 ot 5 hours) to deliver messages
b. It's only sending mail to first recipent in following fashion
1st recipient - gets it
2nd, 3rd or 4th recipents does not get it.
c. E-mails are collect in a text box call txttotalrecipents and they are seperated by comma.

Can anyone please look at it? I would really really appreciated it. I have been working on this for last 3 weeks.
 
Ok don't know about the time thing but think i can solve your missing recipients problem. We have Groupwise at work not Lotus Notes but i think the principles should be the same. I've spent quite a bit of time getting mine to work (adapting something written by someone else).

As far as I can see you're setting the recipients variable up to be a standard string and it needs to be an array.
You're "gluing" address1, address2, address3 etc together in a string when an array can accomodate them much better. If I post my code you should be able to follow it through and adapt it to your module. Note that my array strToRec has 2 dimensions and yours only has 1 so you can drop the first number when defining and re-defining the array. If you have any problems or questions post back and i'll see if i can sort it for you...

Code:
Public Sub Account_Email_NoAdTest()
 On Error GoTo Err_Handler
Dim strTemp As String
Dim varAttach(1) As Variant
' 2D array
ReDim strRecTo(1, i) As Variant
Dim dbs As DAO.Database
Dim rstRecipients As DAO.Recordset
Dim lngCount As Long
Dim varProxies As Variant
Dim cGW As GW

varAttach(0) = AttachmentPath

Set dbs = Application.CurrentDb
Set rstRecipients = dbs.OpenRecordset("SELECT * FROM [tblRecipients];")

' First "slot" in an array is 0 so i needs to be one less than recordcount
i = rstRecipient.RecordCount - 1
' Set up the array to accomodate varying numbers of recipients
ReDim strRecTo(1, i) As String
rstRecipient.MoveFirst
i = 0
While Not rstRecipient.EOF
' First dimension of array is sender name
strRecTo(0, i) = SendRst.[E-Mail]
' Second dimension of array is sender address- in this eg they are both the same
strRecTo(1, i) = SendRst.[E-Mail]
i = i + 1
rstRecipinet.MoveNext
Wend

Set cGW = New GW
With cGW
  .Login
  .BodyText = "Hello," & vbCrLf & vbCrLf & "Please find attached information you requested from London Borough of Hillingdon Social Services Finance." & vbCrLf
  .Subject = "Enquiry Response"
  .RecTo = strRecTo
  .FileAttachments = varAttach
  .FromText = "Enquiry Handler"
  strTemp = .CreateMessage
  .ResolveRecipients strTemp
  If IsArray(.NonResolved) Then MsgBox "Some unresolved recipients."
  .SendMessage strTemp
  .DeleteMessage strTemp, True
End With

Exit_Here:
  Set cGW = Nothing
  Exit Sub

Err_Handler:
  MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical
  Resume Exit_Here

End Sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom