I'm sorry - I should have instructed you to use the Microsoft CDO for NTS
1.2 Library (it's a lot less complicated to use - we were missing some
things in the CDO 2000 code). With the code window open, go to Tools |
References and uncheck Microsoft CDO for Windows 2000. Then scroll down and
find the Microsoft CDO for NTS 1.2 Library and check it. Next, change the
code to be like this (I've marked the lines you need to change with ******
above and below):
Option Compare Database
Private Sub Command0_Click()
'**************
Dim oMail As New CDONTS.NewMail
'**************
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT [Email Address] FROM [tbl_Volunteer
Contact Information]")
Do Until rs.EOF
'**************
If Len(rs(0)) > 0 Then
'**************
oMail.From = "(e-mail address removed)"
oMail.To = rs(0)
oMail.Subject = "CCC Information : Monthly AAP Reminder"
'**************
oMail.Body = "Whatever message you want sent."
'**************
oMail.Send
Set oMail = Nothing
'**************
End If
'**************
rs.MoveNext
Loop
End Sub
The "If...End If" will ensure that there actually is *something* in the To:
field.
bumblebug787 said:
OK - now it reads:
Option Compare Database
Private Sub Command0_Click()
Dim oMail As New CDO.Message
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT [Email Address] FROM [tbl_Volunteer
Contact Information]")
Do Until rs.EOF
oMail.From = "(e-mail address removed)"
oMail.To = rs(0)
oMail.Subject = "CCC Information : Monthly AAP Reminder"
oMail.TextBody = "Whatever message you want sent."
oMail.Send
Set oMail = Nothing
rs.MoveNext
Loop
End Sub
but I get the message:
Runtime Error '13'
Type Mismatch