Why does the rmail-php-class fail if I setText(), but works if I only setHtml()?
I use this class for sending e-mail: http://www.phpguru.org/downloads/Rmail/Rmail%20for%20PHP/docs.html
It was work开发者_如何学Cing until I switched from "mail" to SMTP.
Now, if I use setHtml($html)
it works, but if I also use setText($text)
, it doesn't work.
Can it be that $text
contains some invalid characters?
Why would those characters work when using the system "mail",
but not work on SMTP running on localhost?
It turns out "\n"
characters (LF) are not allowed, only "\r\n"
(CRLF) is acceptable in the e-mail text body.
Somehow among all the CRLF pairs one LF sneaked in, which caused the sending to fail.
Aren't bytes wonderful?
精彩评论