Really not sure I am following, but I can tell you that ShaneEP and myself tested that function a lot before posting it. There have been followup suggestions and those have been incorporated as well. You can provide the body as a String or as a file.

All you have to do is copy the function, as is, no changes, to your script. Follow the examples in the header, or try the example below.

Even if your data is in array, all you have to do is a $body=join($data,@CRLF). So something like this...

 Code:
$To="emailaddress"
$From="emailaddress"
$Subject="Subject"
$Body=join($data,@crlf)
$BodyType="Text"
$Attachment=""
$SMTPServer='smtp.gmail.com'
$SMTPPort=465
$SMTPUseSSL=1
$SMTPUser="emailaddress"
$SMTPPW="password"
 
$rc=sendmail($To,$From,$Subject,$Body,$BodyType,$Attachment,$SMTPServer,$SMTPPort,$STMPUseSSL,$SMTPUser,$SMTPPW)

;copy sendmail UDF below