tags:

views:

23

answers:

1

I use this class for sending e-mail: http://www.phpguru.org/downloads/Rmail/Rmail%20for%20PHP/docs.html

It was working 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?

A: 

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?

Abe Pazos