I have vbscript which will read text file and send mail of content but after running it getting error ----- Expected ')' line - 20


Sub CatchMe()

Dim outobj, mailobj
Dim strFileText
Dim objFileToRead
Set outobj = CreateObject("Outlook.Application")
Set mailobj = outobj.CreateItem(0)
strFileText = GetText("C:\Users\AH0667770\Desktop\New folder (2)\1.txt")
With mailobj
.To = "[email protected]"
.Subject = "Testmail"
.Body = strFileText
.Display
End With
'Clear the memory
Set outobj = Nothing
Set mailobj = Nothing
End Sub

Function GetText(sFile As String) As String
Dim nSourceFile As Integer, sText As String
nSourceFile = FreeFile
'Write the entire file to sText
Open sFile For Input As #nSourceFile
sText = Input$(LOF(1), 1)
Close
GetText = sText
End Function