Hello,
sending emails with Classic ASP to my own Exchange 2016 works without a problem.
(I created a connector to accept mails from the webserver)
Textbody="<h1>1. This is a message.</h1>"
Set objEmail = CreateObject("CDO.Message")
objEmail.To = "to@tiedtlaw email .com"
objEmail.from = "from@tiedtlaw email .com"
objEmail.Subject = "[Tix]: HTML Test Exchange Server"
objEmail.HTMLbody = Textbody
objEmail.Send
Set ojbEmail = NOTHING
Now I found basically this to authenticate and send emails to the Office365 mail server:
Textbody="Sending a text e-mail using a remote server:"
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "Sending email with CDO"
myMail.To = "to@tiedtlaw email .com"
myMail.from = "from@tiedtlaw email .com"
myMail.TextBody = Textbody
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ' or 587
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "email@microsoft.com"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
myMail.Configuration.Fields.Update
myMail.Send
set myMail = nothing
I was using Powershell and was able to authenticate and send an email (see here:
https://answers.microsoft.com/en-us/msoffice/forum/all/using-cdosys-to-send-email-via-smtp/1bf2d068-1f46-4ef3-89af-cdf48cae706a )
But all the tests to send via classic ASP did not work.
I suspect that some TLS or anything like this does not work?
Does it work somewhere?