A: 

This exact code works elsewhere? Are you sure you're passing the arguments to the inArray() function in the right order? A string array and a string passed in the wrong order would cause a Type Mismatch error.

JeffK
exact code... I have since solved this. It has nothing to do with a Type Mismatch at all... inArray() isn't a built in function like I thought it was, it's in an include that I forgot to include. It never occurred to me because the error was so far from "undefined function", which would make sense.
+1  A: 

There is no built in function called InArray() in vbscript. Do you have the function included?

mike nelson
A: 

How about something like this instead:

strOut = ""
strIn = strEmail

strTmp = ""
For Each f In rs2.fields
    If Instr(strIn, "$*%%" & f.name) > 0 Then
        strIn = Replace(strIn, "$*%%" & f.name, rs2(f.Name).Value)
    End If
Next

strOut = strIn
Gordon Bell