4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 //@require 'Swift/Mime/MimePart.php';
12 //@require 'Swift/DependencyContainer.php';
15 * A MIME part, in a multipart message.
18 * @author Chris Corbyn
20 class Swift_MimePart
extends Swift_Mime_MimePart
24 * Create a new MimePart.
25 * Details may be optionally passed into the constructor.
27 * @param string $contentType
28 * @param string $charset
30 public function __construct($body = null, $contentType = null,
34 array($this, 'Swift_Mime_MimePart::__construct'),
35 Swift_DependencyContainer
::getInstance()
36 ->createDependenciesFor('mime.part')
41 $charset = Swift_DependencyContainer
::getInstance()
42 ->lookup('properties.charset');
44 $this->setBody($body);
45 $this->setCharset($charset);
48 $this->setContentType($contentType);
53 * Create a new MimePart.
55 * @param string $contentType
56 * @param string $charset
57 * @return Swift_Mime_MimePart
59 public static function newInstance($body = null, $contentType = null,
62 return new self($body, $contentType, $charset);