in reply to Sendmail doesn't send subject

Please use MIME::Lite or something else instead of piping to sendmail.

Most likely, $wer or $liste[$empf] contains a newline which makes sendmail think that the headers have ended. Where/how do you fill these variables? If they are user submitted or come from outside your program, please consider that this will be used by spammers to send mail through your server to others.