I think I understand you now. When you said "Output" before what you actually meant was "Contents of mail message successfully received", right? So there's no problem other than the contents of the mail being "2" rather than the 2 entries of the array.
If that is the actual situation then whatever sendMail is (and you've still not told us that so what follows is guesswork) probably expects a scalar at that point. If you replace the array with a stringified version of it then perhaps that's all you need. Who knows?
sendMail('abc@xyz.com', "Error in build", "@errorContents", 'abc@xyz.c
+om');
|