Mails sent from AJAX-requested contained {JSON} code in their header instead of formatted HTML.