Hi
I designed a database a few years back that sends automatic e-mail though the smtp port. This is because we use Novell Groupwise instead of Outlook.
This is the code:
Code:
rst.Close
dbs.Close
Set rst = Nothing
Set dbs = Nothing
Set mail = Nothing
' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strEmailTo
Const cdoSendUsingPort = 2
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.1.10.63"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> </b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = strEmailAddress
.cc = CarbonCopy
.From = "Airplane R&D Database. R&D Staff Entry." 'MailFrom 'this should be OK
.Subject = "R&D ID# " & RDID & ". " & ProjectName & ". By " & Commentby
.HTMLBody = TestInput 'this should be OK
.Send 'this should be OK
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
This has been working flawlessly for a few years until now. One user has been upgraded to Windows 7, and since this happened, when the db attempts to send an e-mail from his computer, he gets the following message: "Runtime error -2147220979(8004020d) At least one of the froms or sender fields is required"
Please note that everyone else is still able to send e-mails normally, so the code works...
Does anyone know what is happening? Why would the code work on XP and create problems on Windows 7?
Thanks
mafhobb