1145. Class

1145.1. Zend\Mail\Message

1145.1.1. Methods

1145.1.1.1. isValid

isValid()

Is the message valid?

If we don’t any From addresses, we’re invalid, according to RFC2822.

Return type:bool

1145.1.1.2. setEncoding

setEncoding()

Set the message encoding

Parameters:string
Return type:Message

1145.1.1.3. getEncoding

getEncoding()

Get the message encoding

Return type:string

1145.1.1.4. setHeaders

setHeaders()

Compose headers

Parameters:Headers
Return type:Message

1145.1.1.5. getHeaders

getHeaders()

Access headers collection

Lazy-loads if not already attached.

Return type:Headers

1145.1.1.6. setFrom

setFrom()

Set (overwrite) From addresses

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • string|null
Return type:

Message

1145.1.1.7. addFrom

addFrom()

Add a “From” address

Parameters:
  • string|Address|array|AddressList|Traversable
  • string|null
Return type:

Message

1145.1.1.8. getFrom

getFrom()

Retrieve list of From senders

Return type:AddressList

1145.1.1.9. setTo

setTo()

Overwrite the address list in the To recipients

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • null|string
Return type:

Message

1145.1.1.10. addTo

addTo()

Add one or more addresses to the To recipients

Appends to the list.

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • null|string
Return type:

Message

1145.1.1.11. getTo

getTo()

Access the address list of the To header

Return type:AddressList

1145.1.1.12. setCc

setCc()

Set (overwrite) CC addresses

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • string|null
Return type:

Message

1145.1.1.13. addCc

addCc()

Add a “Cc” address

Parameters:
  • string|Address|array|AddressList|Traversable
  • string|null
Return type:

Message

1145.1.1.14. getCc

getCc()

Retrieve list of CC recipients

Return type:AddressList

1145.1.1.15. setBcc

setBcc()

Set (overwrite) BCC addresses

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • string|null
Return type:

Message

1145.1.1.16. addBcc

addBcc()

Add a “Bcc” address

Parameters:
  • string|Address|array|AddressList|Traversable
  • string|null
Return type:

Message

1145.1.1.17. getBcc

getBcc()

Retrieve list of BCC recipients

Return type:AddressList

1145.1.1.18. setReplyTo

setReplyTo()

Overwrite the address list in the Reply-To recipients

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • null|string
Return type:

Message

1145.1.1.19. addReplyTo

addReplyTo()

Add one or more addresses to the Reply-To recipients

Appends to the list.

Parameters:
  • string|AddressAddressInterface|array|AddressList|Traversable
  • null|string
Return type:

Message

1145.1.1.20. getReplyTo

getReplyTo()

Access the address list of the Reply-To header

Return type:AddressList

1145.1.1.21. setSender

setSender()

setSender

Parameters:
  • mixed
  • mixed
Return type:

Message

1145.1.1.22. getSender

getSender()

Retrieve the sender address, if any

Return type:null|AddressAddressInterface

1145.1.1.23. setSubject

setSubject()

Set the message subject header value

Parameters:string
Return type:Message

1145.1.1.24. getSubject

getSubject()

Get the message subject header value

Return type:null|string

1145.1.1.25. setBody

setBody()

Set the message body

Parameters:null|string|ZendMimeMessage|object
Throws ExceptionInvalidArgumentException:
 
Return type:Message

1145.1.1.26. getBody

getBody()

Return the currently set message body

Return type:object

1145.1.1.27. getBodyText

getBodyText()

Get the string-serialized message body text

Return type:string

1145.1.1.28. getHeaderByName

getHeaderByName()

Retrieve a header by name

If not found, instantiates one based on $headerClass.

Parameters:
  • string
  • string
Return type:

ZendMailHeaderHeaderInterface

1145.1.1.29. clearHeaderByName

clearHeaderByName()

Clear a header by name

Parameters:string

1145.1.1.30. getAddressListFromHeader

getAddressListFromHeader()

Retrieve the AddressList from a named header

Used with To, From, Cc, Bcc, and ReplyTo headers. If the header does not exist, instantiates it.

Parameters:
  • string
  • string
Throws ExceptionDomainException:
 
Return type:

AddressList

1145.1.1.31. updateAddressList

updateAddressList()

Update an address list

Proxied to this from addFrom, addTo, addCc, addBcc, and addReplyTo.

Parameters:
  • AddressList
  • string|AddressAddressInterface|array|AddressList|Traversable
  • null|string
  • string
Throws ExceptionInvalidArgumentException:
 

1145.1.1.32. toString

toString()

Serialize to string

Return type:string

1145.1.1.33. fromString

fromString()

Instantiate from raw message string

Parameters:string
Return type:Message