createDependenciesFor('mime.message') ); if (!isset($charset)) { $charset = Swift_DependencyContainer::getInstance() ->lookup('properties.charset'); } $this->setSubject($subject); $this->setBody($body); $this->setCharset($charset); if ($contentType) { $this->setContentType($contentType); } } /** * Create a new Message. * * @param string $subject * @param string $body * @param string $contentType * @param string $charset * * @return Swift_Message */ public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null) { return new self($subject, $body, $contentType, $charset); } /** * Add a MimePart to this Message. * * @param string|Swift_OutputByteStream $body * @param string $contentType * @param string $charset * * @return Swift_Mime_SimpleMessage */ public function addPart($body, $contentType = null, $charset = null) { return $this->attach(Swift_MimePart::newInstance( $body, $contentType, $charset )); } public function __wakeup() { Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.message'); } }