以下是经典ASP中已经运行的代码,用于发送电子邮件。我们可以对此代码实施SMTP身份验证吗?
我已经实现了使用CDO,但想知道我们是否可以为CDONTS实施SMTP身份验证。请参阅下面的代码:
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.to = "testrecipient@domain.com"
objCDO.From = "testsender@domain.com" 'CustEmail
objCDO.Subject = "Test Subject"
objCDO.BodyFormat = 0
objCDO.MailFormat = 0
objCDO.Body = "This is a test message"
objCDO.Importance = 0 'High importance!
objCDO.Send 'Send off the email!
'Cleanup
Set objCDO = Nothing
ReplySent="Email sent!"
Response.write(ReplySent)
Response.End