Your BCC is not delimited by \r\n
and so the reply-to header is joined to the BCC value (making it invalid).
The mail server is seeing the BCC header as:
BCC:test@test.comReply-to: xxx@example.com
Change to:
$headers = "From: " . strip_tags($from) . "\r\n" . "BCC:test@test.com\r\n";
Side note: strip_tags()
is not enough to protect against a header injection attack. You must validate the from email address properly.