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/Attachment.php | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 h-source/External/swiftmailer/lib/classes/Swift/Attachment.php (limited to 'h-source/External/swiftmailer/lib/classes/Swift/Attachment.php') diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Attachment.php b/h-source/External/swiftmailer/lib/classes/Swift/Attachment.php new file mode 100644 index 0000000..d3779bf --- /dev/null +++ b/h-source/External/swiftmailer/lib/classes/Swift/Attachment.php @@ -0,0 +1,75 @@ +createDependenciesFor('mime.attachment') + ); + + $this->setBody($data); + $this->setFilename($filename); + if ($contentType) + { + $this->setContentType($contentType); + } + } + + /** + * Create a new Attachment. + * @param string|Swift_OutputByteStream $data + * @param string $filename + * @param string $contentType + * @return Swift_Mime_Attachment + */ + public static function newInstance($data = null, $filename = null, + $contentType = null) + { + return new self($data, $filename, $contentType); + } + + /** + * Create a new Attachment from a filesystem path. + * @param string $path + * @param string $contentType optional + * @return Swift_Mime_Attachment + */ + public static function fromPath($path, $contentType = null) + { + return self::newInstance()->setFile( + new Swift_ByteStream_FileByteStream($path), + $contentType + ); + } + +} -- cgit v1.2.3