|
pclib
3.2.0
Lightweight PHP framework
|
Plain data object with email message containing addresses, body of message, status and attachments. More...
Public Member Functions | |
| __construct (array $data=[]) | |
| Create message from $data array (fieldName => value pairs). | |
| set ($name, $value) | |
| Set email field $name to $value. More... | |
| get ($name) | |
| Get email field value. More... | |
| add ($name, $value) | |
| Add another value to address field (for example more "to" addresses). More... | |
| __get ($name) | |
| PHP magic method. More... | |
| __set ($name, $value) | |
| PHP magic method. More... | |
| preview ($templatePath=null) | |
| Show message preview. More... | |
| isValid () | |
| Is message valid? | |
| getRecipients () | |
| Return array of all recipients. | |
| clearRecipients () | |
| Remove all recipients. | |
| setAttachment ($path) | |
| Add attachment. More... | |
| getAttachments () | |
| Return attachments. More... | |
Plain data object with email message containing addresses, body of message, status and attachments.
By class Mailer you can send it, schedule for sending, load/save from/to database, show preview etc.
| __get | ( | $name | ) |
PHP magic method.
Read / write email properties directly (e.g. $address = $message->to)
| __set | ( | $name, | |
| $value | |||
| ) |
PHP magic method.
Read / write email properties directly (e.g. $message->to = 'some@email.com')
| add | ( | $name, | |
| $value | |||
| ) |
Add another value to address field (for example more "to" addresses).
| get | ( | $name | ) |
Get email field value.
| string | $name | ('from', 'to', 'cc', 'bcc', 'replyTo', 'subject', 'body', 'text') |
| getAttachments | ( | ) |
Return attachments.
| preview | ( | $templatePath = null | ) |
Show message preview.
| set | ( | $name, | |
| $value | |||
| ) |
Set email field $name to $value.
For address fields you can use one address or array of addresses. Address field can be plain address or "Some Name <some.name@email.com>" format.
| string | $name | ('from', 'to', 'cc', 'bcc', 'replyTo', 'subject', 'body', 'text') |
| mixed | $value | of the field |
| setAttachment | ( | $path | ) |
Add attachment.
| string | $path | Path to file |