Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
โค้ดครับ
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") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.domain.net"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = email
' MailObj.From = "Mr Sender <[email protected]>"
.From = "Mr Sender <[email protected]>"
.Subject = "Thank you "
.HTMLBody = text
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing