コード例 #1
0
 /**
  * Constructor
  * 
  * @param string $filename    Name of file
  * @param string $contentType Content type of file
  * @param string $encoding    What encoding to use
  */
 public function __construct($filename, $contentType = 'application/octet-stream', $encoding = null)
 {
     $encoding = is_null($encoding) ? new JO_Mail_Base64Encoding() : $encoding;
     parent::__construct(file_get_contents($filename), basename($filename), $contentType, $encoding);
 }
コード例 #2
0
 /**
  * Constructor
  * 
  * @param string $data        File data
  * @param string $name        Name of attachment (filename)
  * @param string $contentType Content type of file
  * @param string $encoding    What encoding to use
  */
 public function __construct($data, $name = '', $contentType = 'application/octet-stream', $encoding = null)
 {
     $encoding = is_null($encoding) ? new JO_Mail_Base64Encoding() : $encoding;
     parent::__construct($data, $name, $contentType, $encoding);
 }