im attempting to send some form details to both an access database and to an email address at the same time.
Ive got the form results going to the database fine and this is all up and running.
However i cannot for the life of me get the form results sent to my email!!! Ive got this code which i dont think is too far from been right - but which areas are wrong??
Help please!!!
Code:
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim flgEmailSent
flgEmailSent = False
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
Set objConfig = CreateObject("CDO.Configuration")
Set objMessage = CreateObject("CDO.Message")
' Set config fields we care about
With objConfig.Fields
.Item(cdoSendUsingMethod) = "cdoSendUsingPort"
.Item(cdoSMTPServer) = "http://217.180.78.26/exchange/"
.Item(cdoSMTPServerPort) = "25"
.Item(cdoSMTPConnectionTimeout) = "10"
.Item(cdoSMTPAuthenticate) = "cdoBasic"
.Item(cdoSendUserName) = "<Myusername>"
.Item(cdoSendPassword) = "<Mypassword>"
.Update
End With
Set objMessage.Configuration = objConfig
With objMessage
.To = "pworsnop@wickersley.net"
.From = "Sender's Email"
.Subject = "Absence Request"
.TextBody = "This is the message"
'or
'.HTMLBody = "<This is the message in HTML>"
On Error Resume Next
.Send
If err.number = 0 Then
flgEmailSent = True
Else
m_strErrors = err.Description
End If
On Error GoTo 0
End With
Set objMessage = Nothing
Set objConfig = Nothing
%>
When i use the above code in the confirmation .asp page it brings up the following error:
Code:
ADODB.Fields error '800a0ea5'
Fields update failed. For further information, examine the Status property of individual field objects.
/AbsenceForm/RecordAdded.asp, line 86
|