格式化要使用phpmailer发送的变量结果


Formating variable results to send with phpmailer

所以,我有存储在数组中的phpmail要发送的结果,我试图给它一个最小的格式,比如:

        $results = array();
            array_walk_recursive(
            $texto, //--- contains other 3 arrays: $texto[] = array($date,$speaker,$msg);
            function ($value, $key) use (&$results) {
            $results[] = $value;
            });
            $texto_forma = implode(''n', $results);

在屏幕上打印是可以的,但当我用phpmailer这样发送时:

            ...
            $texto = "$texto_forma";
    $mail->Body = $texto;
    (!$mail->Send());

我会收到一封邮件,邮件的结果是:blabla,而不是按行分隔。

我可以用什么代替''n?我也尝试过
显然没有预期的结果

非常感谢!!

使用nl2br函数将'n转换为<br'>

还将mime类型的电子邮件发送为HTML,这样它将正确地呈现