CDO.Message.1 错误 '80040213'
与服务器的传输连接失败。
/testsendMaill.asp,行 39就是最后发送哪里。
<%
const email_from="1124663858@qq.com"
const password="fanlianghao"
const eamil_to="1796906142@qq.com"
file = "C:\hello.txt"
set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending mail with CDO"
myMail.From= email_from
myMail.TO= eamil_to
myMail.TextBody="This is a big srupise"
myMail.AddAttachment file'邮件附件文件路径
Const schema = "http://schemas.microsoft.com/cdo/configuration/"
With myMail.Configuration.Fields '用with关键字减少代码输入
.Item(schema & "sendusing") = 2 '使用网络上的SMTP服务器而不是本地的SMTP服务器.Item(schema & "smtpserver") = "smtp.gmail.com" 'SMTP服务器地址
.Item(schema & "smtpauthenticate") = 1 '服务器认证方式
.Item(schema & "sendusername") = email_from '发件人邮箱
.Item(schema & "sendpassword") = Password '发件人邮箱密码
.Item(schema & "smtpserverport") = 465 'SMTP服务器端口
.Item(schema & "smtpusessl") = false '是否使用SSL
.Item(schema & "smtpconnectiontimeout") = 60 '连接服务器的超时时间
.Update '更新设置
End With
myMail.Send '发送邮件
%>