troubleshooting Question

SMTP Relay with Office 365 using Classic ASP

Avatar of brownmetals
brownmetals asked on
ASPMicrosoft 365
15 Comments3 Solutions7102 ViewsLast Modified:
I am trying to send a CDO email message using Classic ASP (VBScript) and Office 365. I have tried everything I can think of in the documentation (, but I can't get this to work. Has anyone else had success with their SMTP relay setup using ASP/CDO?

      Set objMail=CreateObject("CDO.Message")
      Set iConf = CreateObject("CDO.Configuration")
      Set Flds = iConf.Fields
      With Flds
        .Item("") = cdoSendUsingPort
    .Item("") = ""  'also tried
    .Item("") = 30
    .Item("") = 587  'tried 25 and 587
    .Item("") = ""      
    .Item("") = "myPassword"
    .Item("") = 1      'cdoBasic
    .Item(" ") = true            
      End With      
With objMail
   Set .Configuration = iConf
   .From = empEmail
   .To = EmailAddress
   .BCC = empEmail
   .Subject = "My Subject Line Here"
   .HTMLBody = msgBody
End With

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros