The problem is that you're calling sendmail with an hash ref, not a hash.
if ( sendmail $tank[$i] ){}
should be
if ( sendmail %{$tank[$i]} ){}
It looks like you're using Data::Dumper to debug. Good. Notice how there're braces (curly brackets) around the data when you dump $tank[$i]? That means it's a hash ref. Actually since you're not doing anything with the if, using unless would be cleaner.
print $Mail::Sendmail::error unless ( sendmail %{$tank[$i]} );
See perldata and perlsyn.
p.s. If you try to cut down the amount of code you post to a bare minimum that still exhibits your problem, you'll get much better response here. Plus, by isolating the problem, you give yourself a better chance of fixing it yourself!