Camen Design Forum

php mail and strange \r\n behaviour in headers part


No offense, but most of what you're doing is a bad idea.

If you are going to be sending emails you should invest the time to learn (and integrate) a mailing library such as Swift Mailer[1] or PHPMailer[2]; it'll save you a lot of time and effort in the long run. If you want to learn how to send email robustly, read the source of one of the aforementioned libraries.

Doing things manually is a good learning exercise, but in production libraries and abstractions are a Good Thing.



(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn