CDO Mail. I can't seem to get started

Discussion in 'Email' started by JohnR, Nov 15, 2020.

Tags:
  1. I'm in the process of moving a site here and one of the things I'll need to do is send automated emails when people sign up for an account.

    I had CDONTS when it was hosted at a different place, so I kept with CDO here.

    Here's what I started with, but I am getting 'error 8004020f' on the line that is the x.Send.

    both the to and the from emails are valid emails.

    Any suggestions?

    <%
    Dim x
    set x = Server.CreateObject("CDO.Message")
    x.From = "postmaster@thespellingpower.com"
    x.To = "johnr@castlemoyle.com"
    x.Subject ="Subject for CDO mail test"
    x.TextBody = "This is a test for CDO.message"
    x.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "m03.internetmailserver.net"
    x.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    x.Configuration.Fields.Update

    x.Send
    set x = nothing
    %>
     
  2. Elshadriel

    Elshadriel Winhost Staff

    You need to provide SMTP authentication. We also provide sample code here.
     

Share This Page