Re: Ubuntu Linux machine sending HTML emails to Outlook 2003 using PEAR package Mail_Mime
| From: | German Geek | Date: | Tue, 03 Feb 2009 03:52:51 +0000 |
| Subject: | Re: Ubuntu Linux machine sending HTML emails to Outlook 2003 using PEAR package Mail_Mime | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29672@lists.php.net to get a copy of this message | ||
It seems like this solves the issue:
http://pear.php.net/bugs/bug.php?id=12032
Sorry, just hadn't found this
before.
Tim-Hinnerk Heuer
http://www.ihostnz.com
On Tue, Feb 3, 2009 at 1:19 PM, German Geek <geek.de@gmail.com> wrote:
> Hi All,
>
> I'm new to the list. My name is Tim-H. Heuer, live in NZ and am a PHP
> developer since about 2 years...
>
> 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@insiteorg.com");
> $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 (which are slightly
> different to what i get from the local machine!), apparently the PEAR
> library has some (strinct) warnings which i thought should be ok and work:
>
> *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
>
>