--- lib/ezutils/classes/ezmail.php.orig Wed Jul 27 19:50:11 2005 +++ lib/ezutils/classes/ezmail.php Wed Jul 27 20:15:02 2005 @@ -68,6 +68,7 @@ $this->BodyText = false; $this->ExtraHeaders = array(); $this->TextCodec = false; + $this->MultipartBoundary = "ezmail.sadfwgfrgtrk23dwhs." . time(); // Sets some default values include_once( 'lib/version.php' ); @@ -268,6 +269,9 @@ { if ( $type ) $this->ContentType['type'] = $type; + if (preg_match('/^multipart\//i', $type)) { + $this->ContentType['boundary'] = $this->MultipartBoundary; + } if ( $charset ) $this->ContentType['charset'] = $charset; if ( $transferEncoding ) @@ -457,6 +461,14 @@ } /*! + Returns the multipart boundary string. + */ + function multipartBoundary() + { + return $this->MultipartBoundary; + } + + /*! Sets the messageID that this message is a reply to. */ function setReferences( $newReference ) @@ -862,6 +874,7 @@ var $BodyText; var $ExtraHeaders; var $TextCodec; + var $MultipartBoundary; } ?> --- lib/ezutils/classes/ezmailtransport.php.orig Wed Jul 27 20:05:38 2005 +++ lib/ezutils/classes/ezmailtransport.php Wed Jul 27 20:15:23 2005 @@ -82,7 +82,14 @@ $ini =& eZINI::instance(); if ( $ini->hasVariable( 'MailSettings', 'ContentType' ) ) - $mail->setContentType( $ini->variable( 'MailSettings', 'ContentType' ) ); + { + // Only muck with the content-type when we're sending text - + // otherwise, if we we're clever and explicitly set the content + // type on the eZMail object, this happily blats it... which + // sort of bites :( + if (preg_match('/^text\/i', $mail->contentType())) + $mail->setContentType( $ini->variable( 'MailSettings', 'ContentType' ) ); + } $transportType = trim( $ini->variable( 'MailSettings', 'Transport' ) ); $transportObject =& $GLOBALS['eZMailTransportHandler_' . strtolower( $transportType )];