Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: 
 3: /*
 4:  * This file is part of SwiftMailer.
 5:  * (c) 2004-2009 Chris Corbyn
 6:  *
 7:  * For the full copyright and license information, please view the LICENSE
 8:  * file that was distributed with this source code.
 9:  */
10: 
11: /**
12:  * Attachment class for attaching files to a {@link Swift_Mime_Message}.
13:  * @package Swift
14:  * @subpackage Mime
15:  * @author Chris Corbyn
16:  */
17: class Swift_Attachment extends Swift_Mime_Attachment
18: {
19:     /**
20:      * Create a new Attachment.
21:      * Details may be optionally provided to the constructor.
22:      * @param string|Swift_OutputByteStream $data
23:      * @param string                        $filename
24:      * @param string                        $contentType
25:      */
26:     public function __construct($data = null, $filename = null, $contentType = null)
27:     {
28:         call_user_func_array(
29:             array($this, 'Swift_Mime_Attachment::__construct'),
30:             Swift_DependencyContainer::getInstance()
31:                 ->createDependenciesFor('mime.attachment')
32:             );
33: 
34:         $this->setBody($data);
35:         $this->setFilename($filename);
36:         if ($contentType) {
37:             $this->setContentType($contentType);
38:         }
39:     }
40: 
41:     /**
42:      * Create a new Attachment.
43:      * @param  string|Swift_OutputByteStream $data
44:      * @param  string                        $filename
45:      * @param  string                        $contentType
46:      * @return Swift_Mime_Attachment
47:      */
48:     public static function newInstance($data = null, $filename = null, $contentType = null)
49:     {
50:         return new self($data, $filename, $contentType);
51:     }
52: 
53:     /**
54:      * Create a new Attachment from a filesystem path.
55:      * @param  string                $path
56:      * @param  string                $contentType optional
57:      * @return Swift_Mime_Attachment
58:      */
59:     public static function fromPath($path, $contentType = null)
60:     {
61:         return self::newInstance()->setFile(
62:             new Swift_ByteStream_FileByteStream($path),
63:             $contentType
64:             );
65:     }
66: }
67: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen