Function SendMail(strToName,strFromName,strSubjet,strContent)Dim iMsg
Dim iConf
Dim Flds
Dim HTML
'Create the message object.
Set iMsg = CreateObject("CDO.Message") 'Create the configuration object.
Set iConf = iMsg.Configuration With iConf.Fields
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.corpease.net" '"192.168.250.254"
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Update
End With 'Set the To, From, Subject, and Body properties of the message.
With iMsg
.BodyPart.Charset = "gb2312"
.BodyPart.ContentTransferEncoding = "base64"
.To = strToName
.From = strFromName
.Subject = strSubjet
.HTMLBody = strContent
.Send
End With
Set iMsg = NothingEnd Function
.Send这一行报错 错误 '80040211' 请问是什么原因呢?
Dim iConf
Dim Flds
Dim HTML
'Create the message object.
Set iMsg = CreateObject("CDO.Message") 'Create the configuration object.
Set iConf = iMsg.Configuration With iConf.Fields
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.corpease.net" '"192.168.250.254"
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Update
End With 'Set the To, From, Subject, and Body properties of the message.
With iMsg
.BodyPart.Charset = "gb2312"
.BodyPart.ContentTransferEncoding = "base64"
.To = strToName
.From = strFromName
.Subject = strSubjet
.HTMLBody = strContent
.Send
End With
Set iMsg = NothingEnd Function
.Send这一行报错 错误 '80040211' 请问是什么原因呢?
是不是端口坏了~
重试过的,端口肯定没问题