Error with Send Mail Accelerator
I am trying to use the send mail accelerator code to generate an e-mail notification. My code is below. This is the first time I have used this so I'm not sure if I am missing something. I am getting an error that says "At least one of the From or Sender fields required, and neither was found. At line 58." Line 58 is ".Send" towards the bottom of the script? Is there something that needs to be added to this line?
'Declare local variables
Dim strFromAddress
Dim strToAddress
Dim strSubject
Dim strEmailMsgLine
Dim objMsg
Dim objConfig
Dim intSendUsing
Dim strSMTPServer
Dim intSendPort
'Initialize message content variables
strFromAddress = DW.Security.fUserEmailGet(DW.Connection.PstrUserID)
strToAddress = me@usp.org
strSubject = "FDM Load Status"
strEmailMsgLine = "This is the status of the current load"
'Initialize Mail Server variables
'SMTP server name
strSMTPServer = "the.usp.org"
'CdoSendUsing enumeration-1=use smtp on local machine, 2=use smtp over network
intSendUsing = 2
'SMTP port on server
intSMTPPort = 25
'Create CDO configuration object
Set objConfig = CreateObject("CDO.Configuration")
'Set Config object settings
With objConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = intSendUsing
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")= intSMTPPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
'Create CDO message object
Set objMsg = CreateObject("CDO.Message")
'Assign config object to configuration property of message object
Set objMsg.Configuration = objConfig
'Set Message object settings and send mail
With objMsg
.To = strToAddress
.From = strFromAddress
.Subject = strSubject
.TextBody = strEmailMsgLine
.Send
End With
'Destroy message objects
Set objMsg = Nothing
Set objConfig = Nothing
End Sub