error '8004020c' having trouble getting my asp page to email usernames and passwords

Discussion in 'Classic ASP' started by tjbcr, Jan 12, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a form on an asp page to send the clients thier usernames and passwords. the code I am using worked on another client's site (hosted elsewhere) but the modified code does not seem to work on discountasp. I get the following error message



    CDO.Message.1 error '8004020c'


    At least one recipient is required, but none were found.


    /asp/send_password.asp, line 39


    Below is the code: Any suggestions?


    Dim LostPassword__EmailParam
    LostPassword__EmailParam = "m[email protected]"
    If (Request.Form("EmailAddress") <> "") Then
    LostPassword__EmailParam = Request.Form("EmailAddress")
    End If
    %>
    <%
    Dim LostPassword
    Dim LostPassword_numRows


    Set LostPassword = Server.CreateObject("ADODB.Recordset")
    LostPassword.ActiveConnection = MM_Recipes_STRING
    LostPassword.Source = "SELECT UserName, UserPassword FROM Users WHERE UserEmail = '" + Replace(LostPassword__EmailParam, "'", "''") + "'"
    LostPassword.CursorType = 0
    LostPassword.CursorLocation = 2
    LostPassword.LockType = 1
    LostPassword.Open()


    LostPassword_numRows = 0

    Dim ConfirmMessage
    ConfirmMessage = ""
    IF (NOT LostPassword.EOF) THEN
    set sysMail = Server.CreateObject("CDO.Message")
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mysite.com"
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
    sysMail.Configuration.Fields.Update
    sysMail.From = "[email protected]"
    sysMail.To = cStr(Request("EmailAddress"))
    sysMail.Subject = "Re:YourLogin Information"
    sysMail.TextBody = "UserName: " &amp; LostPassword.Fields("UserName").value &amp; vbCrlf &amp; "Password: " &amp; LostPassword.Fields("UserPassword").value
    sysMail.Send
    ConfirmMessage = "Your login information has been sent to: " &amp; cStr(Request("EmailAddress"))
    END IF
    %>
     
  2. It looks like the variables for the To address is not being passed. Try hardcoding it as a test. Second, make sure you set your web application to use 'localhost' as the smtp server. The dasp email servers do not allow web applications to relay emails to them.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page