No, I was referring to the line numbers in Alan's post.
But no problem.
Did you try the altertive I gave in the previous reply ?
Just replace the last line your original script by those 2 lines. You will have to update the parameter values of the Send-Mailmessage cmdlet though.