Path

ez components / documentation / api reference / 1.0.1 / mail


eZ Components 1.0.1

Mail: ezcMailFile

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcMailFile

Mail part for all forms of binary data. [source]
The ezcMailFile class has the following properties:
  • String fileName, the file on disk.
  • String mimeType, the mimetype of the file. ezcMailFile tries to extract this from the file, but you can override it with this property.
  • String contentType, the content type of the file. ezcMailFile tries to extract this from the file, but you can override it with this property. Possible values are: * CONTENT_TYPE_IMAGE * CONTENT_TYPE_VIDEO * CONTENT_TYPE_APPLICATION
  • String dispositionType, if the file should be shown inline in the mail or as an attachment. Possible values are: * DISPLAY_ATTACHMENT * DISPLAY_INLINE
  • int contentId, the ID of this part. Used for internal links within an email. Setting this also sets the header Content-ID.

Parents

ezcMailPart
   |
   --ezcMailFile

Constants

CONTENT_TYPE_APPLICATION = "application" Application content type. Use this if the file non of the other content types match.
CONTENT_TYPE_AUDIO = "audio" Audio content type. Use this if the contents of the file is an audio.
CONTENT_TYPE_IMAGE = "image" Image content type. Use this if the contents of the file is an image.
CONTENT_TYPE_VIDEO = "video" Video content type. Use this if the contents of the file is a video.
DISPLAY_ATTACHMENT = "attachment" Use DISPLAY_ATTACHMENT if you want the file to be displayed as an attachment to the recipients of the mail.
DISPLAY_INLINE = "inline" Use DISPLAY_INLINE if you want the file to be displayed inline in the mail to the recipients.

Method Summary

public void __construct( $fileName )
Constructs a new attachment with $fileName.
public string generateBody( )
Returns the contents of the file with the correct encoding.
public void __get( $name, $value )
Sets the property $name to $value.
public void __set( $name, $value )
Sets the property $name to $value.

Inherited Methods

From ezcMailPart :
public void ezcMailPart::appendExcludeHeaders()
The array $headers will be excluded when the headers are generated.
public string ezcMailPart::generate()
Returns the complete mail part including both the header and the body as a string.
public abstract string ezcMailPart::generateBody()
Returns the body of this part as a string.
public string ezcMailPart::generateHeaders()
Returns the headers set for this part as a RFC 822 string.
public string ezcMailPart::getHeader()
Returns the value of the header $name.
public void ezcMailPart::setHeader()
Sets the header $name to the value $value.

Methods

__construct

void __construct( string $fileName )
Constructs a new attachment with $fileName.

Parameters

Name Type Description
$fileName string  

generateBody

string generateBody( )
Returns the contents of the file with the correct encoding.

Redefinition of

Method Description
ezcMailPart::generateBody() Returns the body of this part as a string.

__get

void __get( string $name, mixed $value )
Sets the property $name to $value.

Parameters

Name Type Description
$name string  
$value mixed  

Throws

ClassDescription
ezcBasePropertyNotFoundException if the property does not exist.

__set

void __set( string $name, mixed $value )
Sets the property $name to $value.

Parameters

Name Type Description
$name string  
$value mixed  

Throws

ClassDescription
ezcBasePropertyNotFoundException if the property does not exist.
ezcBaseFileNotFoundException when setting the property with an invalid filename.

Last updated: Fri, 02 Nov 2007