Email troubles

Results 1 to 2 of 2

Thread: Email troubles

  1. #1
    Alexus Guest

    Default Email troubles

    I am trying to send an email once a form is filled out. I am getting this error and I can&#039t figure out what I&#039m doing wrong:<BR><BR>Request object error &#039ASP 0102 : 80004005&#039 <BR><BR>Expecting string input <BR><BR>/ROI Project/EmailGenform.asp, line 60 <BR><BR>The function expects a string as input. <BR><BR><BR>Here&#039s my code for the email:<BR><BR>&#060;html&#062;<BR>&#060;head&#062; <BR> &#060;title&#062;Email General Form&#060;/title&#062;<BR>&#060;/head&#062;<BR><BR>&#060;body&#062;<BR>&#060;%@ Language = VBScript %&#062;<BR><BR>&#060;%<BR><BR> &#039 The header for the email.<BR> <BR> Const strHeader = "General Form information:"<BR> <BR> &#039Who does this go to?<BR> <BR> Const strTo = ""<BR> <BR> Dim strFrom, strSubject, strRedirectUrl, strFromPath<BR> <BR> strFrom = Request.Form("txtSendToEmailAddress")<BR> if Len(strFrom) = 0 then strFrom = strTo<BR> <BR> strSubject = Request.Form("txtEmailSubject")<BR> if Len(strSubject) = 0 then strSubject = "General Information"<BR> <BR> strRedirectURL = Request.Form("urlSendTo")<BR> if Len(strRedirectURL) = 0 then strRedirectURL = "/"<BR> <BR> strFromPath = Request.Form("urlFromPath")<BR> if Len(strFromPath) = 0 then strFromPath = "Unknown"<BR> <BR> <BR> Dim strBody<BR> strBody = strHeader & vbCrLF & vbCrLF<BR> strBody = strBody & "Form: " & StrFromPath & vbCrLF & _<BR> "Form submitted at " & Now() & vbCrLF & vbCrLF<BR> <BR> Dim myElement<BR> <BR> For Each myElement in Request.Form<BR> <BR> Select Case Left (myElement, 3)<BR> Case "txt", "sel", "rad":<BR> strBody = strBody & Replace (Mid(myElement, 4, len(myElement)),"."," " & ": ")<BR> <BR> if Len(Request.Form(myElement)) = 0 then<BR> strBody = strBody & "unanswered"<BR> <BR> else<BR> <BR> strBody = strBody & Request.Form(myElement)<BR> end if<BR> <BR> strBody = strBody & vbCrLF<BR> <BR> Case "chk":<BR> strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & ": " & _<BR> Request.Form(myElements) & vbCrLF<BR> <BR> End Select<BR> <BR> Next<BR> <BR> &#039 Time to send the email<BR> <BR> Dim objCDO<BR> Set objCDO = Server.CreateObject("CDONTS.NewMail")<BR> objCDO.To = strTo<BR> objCDO.From = strFrom<BR> <BR> objCDO.Subject = strSubject<BR> objCDO.Body = strBody<BR> <BR> objCDO.Send<BR> <BR> Set objCDO = Nothing<BR> <BR> &#039Send them to the page specified<BR> Response.Redirect strRedirectURL<BR> <BR>%&#062;<BR> <BR><BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR><BR>any help would be appreciated!

  2. #2
    NesKen Guest

    Default RE: Email troubles

    My guess:<BR><BR>do a display.write TypeName for your input fields. There is <BR>probably a field that is not considered a string that we think is a string. ASP does that all the time. But other than that I do not know. Sorry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts