protected function addAttachments( \Aimeos\MW\Mail\Message\Iface $msg, array $files )
	{
		foreach( $files as $filename )
		{
			if( ( $content = @file_get_contents( $filename ) ) === false ) {
				throw new \Aimeos\Client\Html\Exception( sprintf( 'File "%1$s" doesn\'t exist', $filename ) );
			}

			if( class_exists( 'finfo' ) )
			{
				try
				{
					$finfo = new \finfo( FILEINFO_MIME_TYPE );
					$mimetype = $finfo->file( $filename );
				}
				catch( \Exception $e )
				{
					throw new \Aimeos\Client\Html\Exception( $e->getMessage() );
				}
			}
			else if( function_exists( 'mime_content_type' ) )
			{
				$mimetype = mime_content_type( $filename );
			}
			else
			{
				$mimetype = 'application/binary';
			}

			$msg->addAttachment( $content, $mimetype, basename( $filename ) );
		}
	}