Attachment
in package
implements
IAttachment
Mail Attachment Object
This object is used to define the parameters of a mail attachment
Tags
Table of Contents
Interfaces
- IAttachment
- Mail Attachment Interface
Properties
Methods
- __construct() : mixed
- initialize the mail attachment object
- getContents() : string|null
- gets the attachment contents (actual data)
- getEmbedded() : bool
- gets the embedded status of the attachment
- getName() : string|null
- gets the attachment file name
- getType() : string|null
- gets the attachment mime type
- setContents() : self
- sets the attachment contents (actual data)
- setEmbedded() : self
- sets the embedded status of the attachment
- setName() : self
- sets the attachment file name
- setType() : self
- sets the attachment mime type
Properties
$contents
protected
string|null
$contents
$embedded
protected
bool
$embedded
= false
$name
protected
string|null
$name
$type
protected
string|null
$type
Methods
__construct()
initialize the mail attachment object
public
__construct(string|null $contents, string|null $name, string|null $type[, bool $embedded = false ]) : mixed
Parameters
- $contents : string|null
-
binary contents of file
- $name : string|null
-
file name (e.g example.txt)
- $type : string|null
-
mime type (e.g. text/plain)
- $embedded : bool = false
-
embedded status of the attachment, default is false
Tags
getContents()
gets the attachment contents (actual data)
public
getContents() : string|null
Tags
Return values
string|null —returns the attachment contents or null if not set
getEmbedded()
gets the embedded status of the attachment
public
getEmbedded() : bool
Tags
Return values
bool —embedded status of the attachment
getName()
gets the attachment file name
public
getName() : string|null
Tags
Return values
string|null —returns the attachment file name or null if not set
getType()
gets the attachment mime type
public
getType() : string|null
Tags
Return values
string|null —returns the attachment mime type or null if not set
setContents()
sets the attachment contents (actual data)
public
setContents(string $value) : self
Parameters
- $value : string
-
binary contents of file
Tags
Return values
self —return this object for command chaining
setEmbedded()
sets the embedded status of the attachment
public
setEmbedded(bool $value) : self
Parameters
- $value : bool
-
true - embedded / false - not embedded
Tags
Return values
self —return this object for command chaining
setName()
sets the attachment file name
public
setName(string $value) : self
Parameters
- $value : string
-
file name (e.g example.txt)
Tags
Return values
self —return this object for command chaining
setType()
sets the attachment mime type
public
setType(string $value) : self
Parameters
- $value : string
-
mime type (e.g. text/plain)
Tags
Return values
self —return this object for command chaining