I get error “Failed to Receive” when i use mail() in php

前端 未结 2 778
野趣味
野趣味 2021-01-24 14:37
$strBody=\"
2条回答
  •  生来不讨喜
    2021-01-24 15:18

    According to the PHP Manual for mail(), the lines in the message must be 70 chars long max. and should be separated with \n (LF). While I've never encountered a problem caused by this, you can give it a try.

    Oh, I generally write down message HTML in a single string like:

    $message = '
        
    ... ...etc... ';

    So it's getting newlines automatically. You can simply trim $strBody=$strBody." parts and concatenate the message into a single multiline string.

    If you can't get it working, you can try ready-made classes like Zend Mail.

提交回复
热议问题