diff options
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r-- | program/steps/mail/sendmail.inc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 70baba039..33f023de1 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -159,9 +159,16 @@ if (!empty($CONFIG['generic_message_footer'])) } } - +// try to autodetect operating system and use the correct line endings // use the configured delimiter for headers -$header_delm = $CONFIG['mail_header_delimiter'] ? $CONFIG['mail_header_delimiter'] : "\r\n"; +if (!empty($CONFIG['mail_header_delimiter'])) + $header_delm = $CONFIG['mail_header_delimiter']; +else if (strtolower(substr(PHP_OS, 0, 3)=='win')) + $header_delm = "\r\n"; +else if (strtolower(substr(PHP_OS, 0, 3)=='mac')) + $header_delm = "\r\n"; +else + $header_delm = "\n"; // create PEAR::Mail_mime instance $MAIL_MIME = new Mail_mime($header_delm); |