I've been writing an application for the company I work for, and when sending a HTML formatted body to QMail it's sending out to external mailboxes fine but loses all formatting when sent internally. I've looked at the actual file in the Maildir folder on the server and the formatting is on the email, is there some very specific combination of headers that I need to pass it other than:

Mime-Version: 1.0 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit

And if so, why would it work when going to other email providers?


qmail never touches the content of your mail, so this is definitely no qmail thing.

Do you probably use wrong line-endings (anything other than \n) which disturb the mail client trying to display the HTML code? If they get transferred by SMTP to another server, maybe that other server is implicitly fixing them. I can't see another reason for any difference between a mail delivered locally and a mail delivered remotely.

How exactly does the mail look like? Could you put an example of the mail on the web, as well as a screenshot of what you're seeing?

  • Here's a sample of the code: Working :- snipt.org/Znml Not working: - snipt.org/Znmo Screenshot - i38.tinypic.com/jp7dd4.png Bit more info on the setup, it's qmail for SMTP, Courier-IMAP for handling the in's and out's and Plesk for email account management. Setting the mail to say redirect from an internal account to gmail also ends up with it not displaying. – Nicholas Smith Aug 27 '10 at 11:38
  • 1
    Obviously, you are missing an empty line after the headers in the not working example... – JanC Aug 27 '10 at 15:35
  • Jan correctly identified the problem. Additionally the mails have different charsets in their header which definitely cannot be a problem of transport as MTAs should never change or re-encode content. – Jonas Aug 27 '10 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.