troubleshooting Question

Microsoft VBScript runtime error '800a01c2'

Avatar of Didget
Didget asked on
Web Development
8 Comments2 Solutions1920 ViewsLast Modified:
Hi
I get this message whenever I click on send in my form mailer.  I'm running an ASP form handler.

Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment: 'SendMail'

/formhandler.asp, line 51

Here is my code:
<% Option Explicit %>
<% Response.buffer = true %>
<%
     Dim frmName, frmSurname, frmEmailAddy
     Dim frmPostalAddress, frmCountry, frmOtherCountry
     Dim frmTelephone, frmInterestIn, frmNumberPeople
     Dim frmDayArrive, frmMonthArrive, frmYearArrive
     Dim frmDayDepart, frmMonthDepart, frmYearDepart
     Dim frmComments
         
     frmName = Request.Form("Name")
     frmSurname = Request.Form("Surname")
     frmEmailAddy = Request.Form("Email")
     frmPostalAddress = Request.Form("PostalAddress")
     frmCountry = Request.Form("Country")
     frmOtherCountry = Request.Form("OtherCountry")
     frmTelephone = Request.Form("Telephone")
     frmInterestIn = Request.Form("InterestIn")
     frmNumberPeople = Request.Form("NumberPeople")
     frmDayArrive = Request.Form("DayArrive")
     frmMonthArrive = Request.Form("MonthArrive")
     frmYearArrive = Request.Form("YearArrive")
     frmDayDepart = Request.Form("DayDepart")
     frmMonthDepart = Request.Form("MonthDepart")
     frmYearDepart = Request.Form("YearDepart")
     frmComments = Request.Form("Comments")
     
     Dim emailBody
     
     emailBody = emailBody & "Name:" & frmName & vbCrLf
     emailBody = emailBody & "Surname:" & frmSurname & vbCrLf
     emailBody = emailBody & "Email:" & frmEmailAddy & vbCrLf
     emailBody = emailBody & vbCrLf
     emailBody = emailBody & "PostalAddress:" & frmPostalAddress & vbCrLf
     emailBody = emailBody & "Country:" & frmCountry  & vbCrLf
     emailBody = emailBody & "OtherCountry:" & frmOtherCountry & vbCrLf
     emailBody = emailBody & "Telephone:" & frmTelephone & vbCrLf
     emailBody = emailBody & "InterestIn:" & frmInterestIn & vbCrLf
     emailBody = emailBody & "NumberPeople:" & frmNumberPeople & vbCrLf
     emailBody = emailBody & "DayArrive:" & frmDayArrive & vbCrLf
     emailBody = emailBody & "MonthArrive:" & frmMonthArrive & vbCrLf
     emailBody = emailBody & "YearArrive:" & frmYearArrive & vbCrLf
     emailBody = emailBody & "DayDepart:" & frmDayDepart & vbCrLf
     emailBody = emailBody & "MonthDepart:" & frmMonthDepart & vbCrLf
     emailBody = emailBody & "YearDepart:" & frmYearDepart & vbCrLf
     emailBody = emailBody &  "Comments:" & frmComments & vbCrLf    
     
     'Response.Write("<TEXTAREA cols=80 rows=60>" & emailBody & "</TEXTAREA>")
     'Response.End
         
     SendMail frmEmailAddy, "martiniq@intekom.co.za, leanne@agnet.co.za", emailBody, 1
     Sub SendMail(sender, recipient, subject, body, importance)
     Response.Clear
     Response.Redirect("http://www.marina-martinique.co.za/thanks.htm")
     Dim mail
Set mail = CreateObject("CDONTS.NewMail")
     mail.MailFormat = 0     ' Mime
     mail.From = sender
     mail.To = recipient
     mail.Subject = subject
     mail.Body = body
     mail.Importance = importance
     mail.Send
     Set mail = Nothing
End Sub
%>

I cannot figure this one out. Please help.
ASKER CERTIFIED SOLUTION
AmericanDogma

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

Join our community to see this answer!
Unlock 2 Answers and 8 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 2 Answers and 8 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