In short

Does Drupal override PHP's mail() function somehow?

Example

We have two identical PHP scripts on our server. One outside of Drupal, and one inside a Drupal module. Both these files call the mail() function to send an HTML email.

The one outside of Drupal sends correctly.

The one inside the Drupal module does not. It falls victim of mangling, requiring the message lines to be no more than 80 characters. (Ensuring that the lines are < 80 characters fixes the issue).

Why would the one outside Drupal send correctly without tweaks, but the one inside the Drupal module not?

PS: I know in a module you wouldn't normally use mail(), you would use the proper Drupal APIs.

Comments

jkingsnorth’s picture

Status: Active » Closed (fixed)

In fact this seems to be a php.ini setting that might be peculiar to our server, that by default Drupal HTTP is not chunked, but outside of the Drupal root it was done automatically.