|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CDONTS help (code)
I am trying to send email with CDONTS in Access but I am getting an error very early in my code:
Public Function checkforemail() Dim myConnection As ADODB.Connection Set myConnection = CurrentProject.Connection Dim myRecordSet As New ADODB.Recordset myRecordSet.ActiveConnection = myConnection 'Dimension variables Dim objCDOMail 'Holds the CDONTS NewMail Object Set objCDOMail = Server.CreateObject("CDONTS.NewMail") <<<-------------------ERROR HERE----------------- 'General variables. Dim eMailAddress1 As String, eMailAddress2 As String Dim EmailBody As String, EmployeeNumber As String Dim DueDate As Date, CurrentDate As Date, LastNotify As Date, Callup As Date Dim Days1 As Integer, Days2 As Integer, Days3 As Integer Dim Reminder1 As String, Callup1 As String Dim Reminder2 As Date, Callup2 As Date Dim countEm As Integer, myMsg As String countEm = 0 'This will keep track of the number of emails sent myRecordSet.Open "MaintenanceJobs", , adOpenStatic, adLockOptimistic myRecordSet.MoveFirst Do Until myRecordSet.EOF 'include all items CurrentDate = Date DueDate = myRecordSet.Fields(7) Days1 = DateDiff("d", DueDate, CurrentDate) 'Find out if the due date is here or past If Days1 = 0 Then eMailAddress1 = DLookup("[EmailName]", "[Employees]", "[EmployeeNumber]='" & myRecordSet.Fields(8).Value & "'") EmailBody = myRecordSet.Fields(11).Value objCDOMail.from = "myemail@somewhere.com" objCDOMail.To = eMailAddress1 objCDOMail.Subject = "Testing CDONTS" objCDOMail.BodyFormat = 1 objCDOMail.Body = [EmailBody] 'Importance of the e-mail (0=Low, 1=Normal, 2=High) 'objCDOMail.Importance = 1 objCDOMail.Send Set objCDOMail = Nothing I am getting the error on the line marked out above...it is a Run Time error 424 just wondering if someone might know whats going on here?? |
|
#2
|
|||
|
|||
|
The error indicates CDONTS isn't installed on your server.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Quote:
thanks, thats what I figured |
|
#4
|
|||
|
|||
|
I am on an XP server...can I use the CDO email method without any add-ons to the IIS??
|
|
#5
|
|||
|
|||
|
Search for CDOSYS is the best I can offer, I use a different commercial Email component in my code and I'm not real familiar with any CDOwhatever stuff.
|
|
#6
|
|||
|
|||
|
Quote:
what do you use?? |
|
#7
|
|||
|
|||
|
|
![]() |
| Viewing: ASP Free Forums > System Administration > Microsoft IIS > CDONTS help (code) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|