Text
extends AbstractPart
in package
Text message part class
Tags
Table of Contents
Constants
- _7BIT = '_7BIT'
- _8BIT = '_8BIT'
- BASE64 = 'BASE64'
- Encoding constants
- BINARY = 'BINARY'
- QUOTED_PRINTABLE = 'QUOTED_PRINTABLE'
Properties
- $charSet : string|null
- Character set
- $content : string|null
- Message part content
- $contentType : string|null
- Content type
- $encoding : string|null
- Message part encoding
- $headers : array<string|int, mixed>
- Headers
- $id : string|null
- Message or part ID
- $idHeader : string|null
- Message or part ID header name
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Render message to string
- addHeader() : AbstractMessage
- Add message part header
- addHeaders() : AbstractMessage
- Add message part headers
- generateId() : string
- Generate a new ID
- getBody() : string|null
- Get body
- getCharSet() : string|null
- Get message part character set
- getContent() : string|null
- Get message part content
- getContentType() : string|null
- Get message part content type
- getEncoding() : string|null
- Get message part encoding
- getHeader() : string|null
- Get message part header
- getHeaderAsString() : string|null
- Get header as string
- getHeaders() : array<string|int, mixed>
- Get all message part headers
- getHeadersAsString() : string
- Get all message headers as string
- getId() : string|null
- Get the ID
- getIdHeader() : string|null
- Get the ID
- hasHeader() : bool
- Determine if message part has header
- is7Bit() : bool
- Check if encoding is 7-bit
- is8Bit() : bool
- Check if encoding is 8-bit
- isBase64() : bool
- Check if encoding is base64
- isQuotedPrintable() : bool
- Check if encoding is quoted printable
- render() : string
- Render
- renderAsLines() : array<string|int, mixed>
- Render as an array of lines
- setCharSet() : AbstractMessage
- Set message part character set
- setContent() : AbstractPart
- Set message part content
- setContentType() : AbstractMessage
- Set message part content type
- setEncoding() : AbstractPart
- Set message part encoding
- setId() : AbstractMessage
- Set the ID
- setIdHeader() : AbstractMessage
- Set the ID header name
- getRandomId() : string
- Returns a random ID
Constants
_7BIT
public
mixed
_7BIT
= '_7BIT'
_8BIT
public
mixed
_8BIT
= '_8BIT'
BASE64
Encoding constants
public
string
BASE64
= 'BASE64'
BINARY
public
mixed
BINARY
= 'BINARY'
QUOTED_PRINTABLE
public
mixed
QUOTED_PRINTABLE
= 'QUOTED_PRINTABLE'
Properties
$charSet
Character set
protected
string|null
$charSet
= null
$content
Message part content
protected
string|null
$content
= null
$contentType
Content type
protected
string|null
$contentType
= null
$encoding
Message part encoding
protected
string|null
$encoding
= null
$headers
Headers
protected
array<string|int, mixed>
$headers
= []
$id
Message or part ID
protected
string|null
$id
= null
$idHeader
Message or part ID header name
protected
string|null
$idHeader
= null
Methods
__construct()
Constructor
public
__construct(string $content[, string $contentType = 'text/plain' ][, string|null $encoding = null ][, bool $chunk = false ]) : mixed
Instantiate the message part object
Parameters
- $content : string
- $contentType : string = 'text/plain'
- $encoding : string|null = null
- $chunk : bool = false
__toString()
Render message to string
public
__toString() : string
Return values
stringaddHeader()
Add message part header
public
addHeader(string $header, string $value) : AbstractMessage
Parameters
- $header : string
- $value : string
Return values
AbstractMessageaddHeaders()
Add message part headers
public
addHeaders(array<string|int, mixed> $headers) : AbstractMessage
Parameters
- $headers : array<string|int, mixed>
Return values
AbstractMessagegenerateId()
Generate a new ID
public
generateId([string|null $domain = null ]) : string
Parameters
- $domain : string|null = null
Tags
Return values
stringgetBody()
Get body
public
abstract getBody() : string|null
Return values
string|nullgetCharSet()
Get message part character set
public
getCharSet() : string|null
Return values
string|nullgetContent()
Get message part content
public
getContent() : string|null
Return values
string|nullgetContentType()
Get message part content type
public
getContentType() : string|null
Return values
string|nullgetEncoding()
Get message part encoding
public
getEncoding() : string|null
Return values
string|nullgetHeader()
Get message part header
public
getHeader(string $header) : string|null
Parameters
- $header : string
Return values
string|nullgetHeaderAsString()
Get header as string
public
getHeaderAsString(string $header) : string|null
Parameters
- $header : string
Return values
string|nullgetHeaders()
Get all message part headers
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getHeadersAsString()
Get all message headers as string
public
getHeadersAsString([array<string|int, mixed> $omitHeaders = [] ]) : string
Parameters
- $omitHeaders : array<string|int, mixed> = []
Return values
stringgetId()
Get the ID
public
getId() : string|null
Return values
string|nullgetIdHeader()
Get the ID
public
getIdHeader() : string|null
Return values
string|nullhasHeader()
Determine if message part has header
public
hasHeader(string $header) : bool
Parameters
- $header : string
Return values
boolis7Bit()
Check if encoding is 7-bit
public
is7Bit() : bool
Return values
boolis8Bit()
Check if encoding is 8-bit
public
is8Bit() : bool
Return values
boolisBase64()
Check if encoding is base64
public
isBase64() : bool
Return values
boolisQuotedPrintable()
Check if encoding is quoted printable
public
isQuotedPrintable() : bool
Return values
boolrender()
Render
public
abstract render() : string
Return values
stringrenderAsLines()
Render as an array of lines
public
abstract renderAsLines() : array<string|int, mixed>
Return values
array<string|int, mixed>setCharSet()
Set message part character set
public
setCharSet([string|null $charSet = null ]) : AbstractMessage
Parameters
- $charSet : string|null = null
Return values
AbstractMessagesetContent()
Set message part content
public
setContent(string $content) : AbstractPart
Parameters
- $content : string
Return values
AbstractPartsetContentType()
Set message part content type
public
setContentType(string $contentType) : AbstractMessage
Parameters
- $contentType : string
Return values
AbstractMessagesetEncoding()
Set message part encoding
public
setEncoding(string $encoding) : AbstractPart
Parameters
- $encoding : string
Return values
AbstractPartsetId()
Set the ID
public
setId(string $id) : AbstractMessage
Parameters
- $id : string
Return values
AbstractMessagesetIdHeader()
Set the ID header name
public
setIdHeader(string $header) : AbstractMessage
Parameters
- $header : string
Return values
AbstractMessagegetRandomId()
Returns a random ID
protected
getRandomId([string|null $idRight = null ]) : string
Parameters
- $idRight : string|null = null