I have added wordwrap in mail function. But br tag that I am using in wordwrap is not working in mail.
$class_name_1 = wordwrap($class_name, 25, '<br>');
Also added headers
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";