CDO Send Error

Discussion in 'Site Programming, Development and Design' started by danimaltex, Dec 9, 2009.

  1. Can someone please help me resolve the SMTP authentication issue im having? Im not sure what to put to let the emails pass through....im getting this error:

    error '8004020f'
    /register.asp, line 89

    using this code:

    IF rsNewEmailUser.EOF then
    Set rsNewUser = adoCon.Execute(strSQL)
    htmlBody = "Welcome to ASPLogin Secure Site<br><br>Please keep this email for your records. Your account information is as follows:<br><br>--------------------<br>Username: "
    htmlBody = htmlBody & strUserName & "<br>"
    htmlBody = htmlBody & "Password: "
    htmlBody = htmlBody & strUserPassNE & "<br>--------------------<br>"
    htmlBody = htmlBody & "<br>Your account is currently inactive. You cannot use it until you visit the following link:<br><br>"
    htmlBody = htmlBody & "<a href=http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL") & "?mode=activate&email=" & strEmail & "&confirm=" & strConfirm & ">"
    htmlBody = htmlBody & "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL") & "?mode=activate&email=" & strEmail & "&confirm=" & strConfirm & "</a>"
    htmlBody = htmlBody & "<br>"
    htmlBody = htmlBody & "<br>--------------------<br><br> Thank you for registering."
    Set objCDOSYSMail = Server.CreateObject("CDO.Message")
    Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = vEmailServer
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "******"
    objCDOSYSCon.Fields.Update
    Set objCDOSYSMail.Configuration = objCDOSYSCon
    objCDOSYSMail.From = vSiteEmail
    objCDOSYSMail.To = strEmail
    objCDOSYSMail.Subject = "New Account"
    objCDOSYSMail.HTMLBody = htmlBody
    objCDOSYSMail.Send
    Set objCDOSYSMail = Nothing
    Set objCDOSYSCon = Nothing
     
  2. Ray

    Ray

    Can you try posting a copy of your coding on this thread so I can look through it?
     
  3. Thanks for your help!
    What all did you need to see? I think that is pretty much the complete mailsend component
     
  4. Ray

    Ray

    The error message states...

    /register.asp, line 89


    I guess we can start with about 5 lines before this line and 5 lines after this line. Basically I want to double check how you setup the smtp server and how you are passing the login and password.
     

Share This Page