用下面的脚本发邮件(相关参数已赋值),出现错误
553 authentication is required- NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
- set Email = CreateObject("CDO.Message")
- Email.From = "发件人地址"
- Email.To = "收件人地址"
- Email.Subject = "测试"
- x="内容文件的绝对路径"
- y="附件绝对路径"
- Set fso=CreateObject("Scripting.FileSystemObject")
- Set myfile=fso.OpenTextFile(x,1,Ture)
- c=myfile.readall
- myfile.Close
- Email.Textbody = c
- Email.AddAttachment y
- with Email.Configuration.Fields
- .Item(NameSpace&"sendusing") = 2
- .Item(NameSpace&"smtpserver") = "邮箱服务器"
- .Item(NameSpace&"smtpserverport") = 25
- .Item(NameSpace&"smtpauthenticate") = 1
- .Item(NameSpace&"sendusername") = "用户名"
- .Item(NameSpace&"sendpassword") = "密码"
- .Update
- end with
- Email.Send
- Set Email=Nothing
复制代码 我已经设置了用户名和密码啊,邮箱服务器是smtp.163.com,操作系统是WIN 2003 SERVER,需要配置哪里吗?防火墙没开。 |