Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



google/appengine/api/mail/BaseMessage.php

Table of Contents
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\google\appengine\api\mail\BaseMessage

Package: Default
Abstract base class for sending mail using the App Engine mail APIs.
Children
\google\appengine\api\mail\AdminMessage
\google\appengine\api\mail\Message

Methods

method public __construct (array $options = null) : void

Construct an instance of Message.

Parameters
Name Type Description
$options array

Options for message content, key as per set_functions shown above, value to be set.

Throws
Exception Description
\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.
method public addAttachment (string $filename, mixed $data, string $content_id = null) : void

Adds an attachment to the Message object.

Parameters
Name Type Description
$filename string

Filename of the attachment.

$data mixed

File data of the attachment.

$content_id string

Optional Content-ID header value of the attachment. Must be enclosed by angle brackets (<>).

Throws
Exception Description
\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).
method public addAttachmentArray (array $attach_array) : void

Adds an array of attachments to the Message object.

Parameters
Name Type Description
$attach_array array

Attachments as filename => data pairs. Example: array("filename.txt" => "This is the file contents.");

Throws
Exception Description
\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).
Details
Deprecated
method public addAttachmentsArray (array $attach_array) : void

Adds an array of attachments to the Message object.

Parameters
Name Type Description
$attach_array 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' => ' ']]

Throws
Exception Description
\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).
method public addHeader (string $key, string $value) : void

Adds a header pair to the mail object.

Parameters
Name Type Description
$key string

Header name (from the whitelist) to be added.

$value string

Header value to be added.

Throws
Exception Description
\InvalidArgumentException If the header is not on the whitelist, or if the header is invalid (i.e. not a string).
method public addHeaderArray (array $header_array) : void

Adds an array of headers to the mail object.

Parameters
Name Type Description
$header_array array

An array of headers.

Throws
Exception Description
\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).
method public clearAttachments () : void

Clear all attachments from the mail object.

method public clearHeaders () : void

Clear all headers from the mail object.

method public send () : void
abstract

method public setHtmlBody (string $text) : void

Sets HTML content for the email body.

Parameters
Name Type Description
$text string

HTML to add.

Throws
Exception Description
\InvalidArgumentException If text is not a string.
method public setReplyTo (string $email) : void

Sets a reply-to address for the mail object.

Parameters
Name Type Description
$email string

Reply-to address.

Throws
Exception Description
\InvalidArgumentException If the input reply-to address is an invalid email address.
method public setSender (string $email) : void

Sets the sender for the mail object.

Parameters
Name Type Description
$email string

Email of the sender.

Throws
Exception Description
\InvalidArgumentException If the input sender is an invalid email address.
method public setSubject (string $subject) : void

Sets the subject for the mail object.

Parameters
Name Type Description
$subject string

Subject line.

Throws
Exception Description
\InvalidArgumentException If subject line is not a string.
method public setTextBody (string $text) : bool

Sets plain text for the email body.

Parameters
Name Type Description
$text string

Plain text to add.

Returns
Type Description
bool True if successful, false otherwise.
Throws
Exception Description
\InvalidArgumentException If text is not a string.
Documentation was generated by phpDocumentor 2.0.0a12 .