1: <?php
2:
3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13: 14: 15: 16:
17: class Swift_Message extends Swift_Mime_SimpleMessage
18: {
19: 20: 21: 22: 23: 24: 25: 26:
27: public function __construct($subject = null, $body = null, $contentType = null, $charset = null)
28: {
29: call_user_func_array(
30: array($this, 'Swift_Mime_SimpleMessage::__construct'),
31: Swift_DependencyContainer::getInstance()
32: ->createDependenciesFor('mime.message')
33: );
34:
35: if (!isset($charset)) {
36: $charset = Swift_DependencyContainer::getInstance()
37: ->lookup('properties.charset');
38: }
39: $this->setSubject($subject);
40: $this->setBody($body);
41: $this->setCharset($charset);
42: if ($contentType) {
43: $this->setContentType($contentType);
44: }
45: }
46:
47: 48: 49: 50: 51: 52: 53: 54:
55: public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null)
56: {
57: return new self($subject, $body, $contentType, $charset);
58: }
59:
60: 61: 62: 63: 64: 65:
66: public function addPart($body, $contentType = null, $charset = null)
67: {
68: return $this->attach(Swift_MimePart::newInstance(
69: $body, $contentType, $charset
70: ));
71: }
72:
73: public function __wakeup()
74: {
75: Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.message');
76: }
77: }
78: