![]() |
App Engine PHP SDK
v1 rev.445
The PHP runtime is available as an experimental Preview feature.
|
Public Member Functions | |
send () | |
__construct ($options=null) | |
addAttachment ($filename, $data, $content_id=null) | |
addAttachmentArray ($attach_array) | |
addAttachmentsArray ($attach_array) | |
addHeader ($key, $value) | |
addHeaderArray ($header_array) | |
clearAttachments () | |
clearHeaders () | |
setHtmlBody ($text) | |
setReplyTo ($email) | |
setSender ($email) | |
setSubject ($subject) | |
setTextBody ($text) | |
Protected Member Functions | |
getFunctionArray () | |
checkValidAttachment ($filename, &$error) | |
checkValidEmail ($email) | |
checkValidHeader ($key, $value, &$error) | |
handleApplicationError ($e) | |
Protected Attributes | |
$message = null | |
Static Protected Attributes | |
static | $allowed_headers |
static | $extension_blacklist |
static | $set_functions |
Abstract base class for sending mail using the App Engine mail APIs.
google\appengine\api\mail\BaseMessage::__construct | ( | $options = null | ) |
Construct an instance of Message.
array | $options | Options for message content, key as per set_functions shown above, value to be set. |
InvalidArgumentException If the options variable passed was not an array, if an invalid option was set in the options array, or if a value to be set by the options array was invalid. |
google\appengine\api\mail\BaseMessage::addAttachment | ( | $filename, | |
$data, | |||
$content_id = null |
|||
) |
Adds an attachment to the Message object.
string | $filename | Filename of the attachment. |
mixed | $data | File data of the attachment. |
string | $content_id | Optional Content-ID header value of the attachment. Must be enclosed by angle brackets (<>). |
InvalidArgumentException If the input is not an array or if the attachment type is invalid (i.e. the filename is not a string, or the file extension is blacklisted). |
google\appengine\api\mail\BaseMessage::addAttachmentArray | ( | $attach_array | ) |
Adds an array of attachments to the Message object.
array | Attachments as filename => data pairs. Example: array("filename.txt" => "This is the file contents."); |
InvalidArgumentException If the input is not an array or if the attachment type is invalid (i.e. the filename is not a string, or the file extension is blacklisted). |
google\appengine\api\mail\BaseMessage::addAttachmentsArray | ( | $attach_array | ) |
Adds an array of attachments to the Message object.
array | Array of arrays that represent attachments. Each attachment array supports name, data, and (optionally) content_id keys. Example: [['name' => 'foo.jpg', 'data' => 'data', 'content_id' => '<foo>']] |
InvalidArgumentException If the input is not an array or if the attachment type is invalid (i.e. the filename is not a string, or the file extension is blacklisted). |
google\appengine\api\mail\BaseMessage::addHeader | ( | $key, | |
$value | |||
) |
Adds a header pair to the mail object.
string | $key | Header name (from the whitelist) to be added. |
string | $value | Header value to be added. |
InvalidArgumentException If the header is not on the whitelist, or if the header is invalid (i.e. not a string). |
google\appengine\api\mail\BaseMessage::addHeaderArray | ( | $header_array | ) |
Adds an array of headers to the mail object.
array | An array of headers. |
InvalidArgumentException If the input is not an array, or if headers are not on the whitelist, or if a header is invalid (i.e. not a string). |
|
protected |
Checks that an attachment is valid.
string | $filename | Filename of the attachment. |
string | &$error | Error message to be set if the header is invalid. |
|
protected |
Checks that an email is valid.
string | The email to be validated. |
|
protected |
Check validity of a header pair.
string | $key | Header key. |
string | $value | Header value. |
string | &$error | Error message to be set if the header is invalid. |
google\appengine\api\mail\BaseMessage::clearAttachments | ( | ) |
Clear all attachments from the mail object.
google\appengine\api\mail\BaseMessage::clearHeaders | ( | ) |
Clear all headers from the mail object.
|
protected |
Handles application errors generated by the RPC call.
ApplicationError | An exception caught during the RPC call. |
RuntimeException If there was an internal error or bad request. | |
InvalidArgumentException If there was an unauthorized sender, an invalid attachment type, or an invalid header name. | |
ApplicationError | If the error is not one of the above. |
google\appengine\api\mail\BaseMessage::setHtmlBody | ( | $text | ) |
Sets HTML content for the email body.
string | $text | HTML to add. |
InvalidArgumentException If text is not a string. |
google\appengine\api\mail\BaseMessage::setReplyTo | ( | ) |
Sets a reply-to address for the mail object.
string | Reply-to address. |
InvalidArgumentException If the input reply-to address is an invalid email address. |
google\appengine\api\mail\BaseMessage::setSender | ( | ) |
Sets the sender for the mail object.
string | Email of the sender. |
InvalidArgumentException If the input sender is an invalid email address. |
google\appengine\api\mail\BaseMessage::setSubject | ( | $subject | ) |
Sets the subject for the mail object.
string | $subject | Subject line. |
InvalidArgumentException If subject line is not a string. |
google\appengine\api\mail\BaseMessage::setTextBody | ( | $text | ) |
Sets plain text for the email body.
string | $text | Plain text to add. |
InvalidArgumentException If text is not a string. |
|
staticprotected |
|
staticprotected |
|
staticprotected |