From 232aa1924c8c0f10d87b210b46c9f061af5c844c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 17 Oct 2010 13:29:57 +0000 Subject: added files --- .../swiftmailer/lib/classes/Swift/EmbeddedFile.php | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 h-source/External/swiftmailer/lib/classes/Swift/EmbeddedFile.php (limited to 'h-source/External/swiftmailer/lib/classes/Swift/EmbeddedFile.php') diff --git a/h-source/External/swiftmailer/lib/classes/Swift/EmbeddedFile.php b/h-source/External/swiftmailer/lib/classes/Swift/EmbeddedFile.php new file mode 100644 index 0000000..34d096c --- /dev/null +++ b/h-source/External/swiftmailer/lib/classes/Swift/EmbeddedFile.php @@ -0,0 +1,73 @@ +createDependenciesFor('mime.embeddedfile') + ); + + $this->setBody($data); + $this->setFilename($filename); + if ($contentType) + { + $this->setContentType($contentType); + } + } + + /** + * Create a new EmbeddedFile. + * @param string|Swift_OutputByteStream $data + * @param string $filename + * @param string $contentType + * @return Swift_Mime_EmbeddedFile + */ + public static function newInstance($data = null, $filename = null, + $contentType = null) + { + return new self($data, $filename, $contentType); + } + + /** + * Create a new EmbeddedFile from a filesystem path. + * @param string $path + * @return Swift_Mime_EmbeddedFile + */ + public static function fromPath($path) + { + return self::newInstance()->setFile( + new Swift_ByteStream_FileByteStream($path) + ); + } + +} -- cgit v1.2.3