client/html/src/Client/Html/Email/Payment/Standard.php
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 ) );
		}
	}
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 ) );
		}
	}
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 ) ) ; } }
Adds the given list of files as attachments to the mail message object

@param \Aimeos\MW\Mail\Message\Iface $msg Mail message
@param array $files List of absolute file paths
Adds the given list of files as attachments to the mail message object