请参考以下代码:
<?php
$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);
?>

解决方案 »

  1.   

    <?php
    $to      = '[email protected]';
    $subject = 'the subject';
    $message = '第一行'."\r\n".
              '第二行'."\r\n";
    $headers = 'From: [email protected]' . "\r\n" .
        'Reply-To: [email protected]' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);
    ?>
      

  2.   

    楼上正解。要不换成<br>试试。
      

  3.   

    what kind of mail client you use?  WEB  ??
      

  4.   

    以上方式都全部试过,还是不行,晕,只能以html 格式发送邮件内容吗?
      

  5.   

    直接在编辑器里打回车就行了
    比如
    $content = "name: mynamesucks,
    sex: male,
    country: China";这样发出去的邮件就会换行了,我以前做的时候就是这么做的
      

  6.   

    把phpmailer对象的属性wordwrap设置为一个数字,例如:50。不要设置为0