PHP Linux/Windows Outlook 2003 HTML email problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

We've got a problem with our Ubuntu Linux machine sending HTML emails to
Outlook 2003:

It's an Ubuntu Server (uname -a
Linux CDR2-221 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686
GNU/Linux)

with the newest version of Postfix installed as the Mail server.

Unfortunately, all emails sent as HTML, using the PEAR library for sending
email like so:

  public static function sendEmail($fromEmail, $recipientsEmails, $subject,
$txtBody, $htmlBody = null, $ccEmails = null) {
    require_once 'Mail.php';
    require_once 'Mail/mime.php';

    $message = new Mail_mime();
    $message->setTXTBody($txtBody);
    if (!$htmlBody) $htmlBody = str_replace("\n", "<br />\n", $txtBody);
    $message->setHTMLBody($htmlBody);
    $message->setFrom($fromEmail);
    if ($ccEmails) {
      if (!is_array($ccEmails)) $ccEmails = array($ccEmails);
      foreach ($ccEmails as $cc) {
        $message->addCc($cc);
      }
    }
    //$message->addCc("mike@xxxxxxxxxxxxx");
    $message->setSubject($subject);

    $body = $message->get();
    $headers = $message->headers();

    $mail = Mail::factory("mail");
    if (!is_array($recipientsEmails)) $recipientsEmails =
array($recipientsEmails);
    foreach ($recipientsEmails as $mailto) {
      $mail->send($mailto, $headers, $body);
    }
  }

arrive with only the plaintext part in Outlook 2003 (and only in Outlook
2003). All other email programs (Outlook 2007 e.g.) seem to work fine with
the formatting.

This only started happening on the Linux machine and works fine when emails
are sent by a windows host or another mail server from the ISP. So i suspect
it must be the setup of Postfix on that machine that is not quite correct.

Other than that, i get the following messages from PHP, apparently the PEAR
library has some (strinct) warnings which i thought should be ok:

*Strict Standards*: Assigning the return value of new by reference is
deprecated in */usr/share/php/Mail.php* on line *154*

*Strict Standards*: Assigning the return value of new by reference is
deprecated in */usr/share/php/PEAR.php* on line *569*

*Strict Standards*: Assigning the return value of new by reference is
deprecated in */usr/share/php/PEAR.php* on line *572*

*Strict Standards*: Non-static method Mail::factory() should not be called
statically in */home/magsbyme/www/
ljhooker.ddm.magsbyme.com/lib/myTools.class.php* on line *1035*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail.php* on line *156*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *115*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method Mail::factory() should not be called
statically in */home/magsbyme/www/
ljhooker.ddm.magsbyme.com/lib/myTools.class.php* on line *1035*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail.php* on line *156*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *115*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method Mail::factory() should not be called
statically in */home/magsbyme/www/
ljhooker.ddm.magsbyme.com/lib/myTools.class.php* on line *1035*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail.php* on line *156*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *115*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::raiseError() should not be
called statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *136*

*Strict Standards*: Non-static method PEAR::getStaticProperty() should not
be called statically, assuming $this from incompatible context in *
/usr/share/php/PEAR.php* on line *867*

*Strict Standards*: Non-static method Mail::factory() should not be called
statically in */home/magsbyme/www/
ljhooker.ddm.magsbyme.com/lib/myTools.class.php* on line *1035*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail.php* on line *156*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *115*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method Mail::factory() should not be called
statically in */home/magsbyme/www/
ljhooker.ddm.magsbyme.com/lib/myTools.class.php* on line *1035*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail.php* on line *156*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *115*

*Strict Standards*: is_a(): Deprecated. Please use the instanceof operator
in */usr/share/php/PEAR.php* on line *281*

*Strict Standards*: Non-static method PEAR::raiseError() should not be
called statically, assuming $this from incompatible context in *
/usr/share/php/Mail/mail.php* on line *136*

*Strict Standards*: Non-static method PEAR::getStaticProperty() should not
be called statically, assuming $this from incompatible context in *
/usr/share/php/PEAR.php* on line *867*

*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/share/php/Mail.php:154) in */home/magsbyme/www/
ljhooker.ddm.magsbyme.com/lib/symfony/exception/sfException.class.php* on
line *101

*Hope this information is enough for someone to know what's going on. Help
is much appreciated.
Thanks,
Tim

Tim-Hinnerk Heuer

http://www.ihostnz.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux