0

Below is an already working code in classic ASP to send an email. Can we implement SMTP authentication to this code?

I have implemented using CDO, but would like to know if we can implement SMTP authentication for CDONTS. Please see my code below:

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
Biju P Dais
  • 131
  • 1
  • 12
  • 2
    CDONTS was dropped from Windows Server 2003, so any server on which you find it is going to be pretty old, unless you've chosen to install it yourself. As far as I know CDONTS doesn't allow you to use a remote server, you can only use the one on the local machine (if it exists), so there's no equivalent of the CDO config section – John May 23 '18 at 15:40
  • @John, Thank you for the confirmation. How can we check if an SMTP server exists in the local machine? – Biju P Dais May 24 '18 at 04:02
  • 1
    This might help https://support.office.com/en-us/article/how-to-configure-iis-for-relay-with-office-365-eb57abd2-3859-4e79-b721-2ed1f0f579c9 – John May 24 '18 at 08:16
  • @John, Thank you, I will take a look at this. Sorry for the late reply. :) – Biju P Dais May 29 '18 at 06:02

0 Answers0