Qmail and PHPs mail() function - Blog - Open Source - schlitt.info

schlitt.info - php, photography and private stuff

Qmail and PHPs mail() function

While working with the eZ Mail component, for sending some emails comfortably, I noticed some issue with my Qmail installation. With some email accounts that received the emails, the headers were broken and had double line break characters, so the complete email was broken. That (weirdly) happened only with some servers (e.g. Gmail), while my own server handeled the emails gracefully.

The problem here was not our Mail component, which (correctly taken over from the PHP manual) used "rn", but my Qmail installation. The sendmail-wrapper delivered with Qmail seems to have an issue here and requiresyou to use just "n". However, our Mail component allows you to change the characters used for line breaks and you can simply do:

<?php ezcMailTools::setLineBreak( "\n" ); ?>

on the components tool class before building your mail and everything will work fine.

Wie also added a note to our manual, so that nobody else will fall into this pitt.

If you liked this blog post or learned something, please consider using flattr to contribute back: .



Add new comment

Fields with bold names are mandatory.