PHP 클래스 Zend_Mail

상속: extends Zend_Mime_Message
파일 보기 프로젝트 열기: kimai/kimai 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$hasAttachments boolean Flag: whether or not email has attachments

보호된 프로퍼티들

프로퍼티 타입 설명
$_bodyHtml false | Zend_Mime_Part text/html MIME part
$_bodyText false | Zend_Mime_Part text/plain MIME part
$_charset string Mail character set
$_date string Date: header
$_defaultFrom array
$_defaultReplyTo array
$_defaultTransport Zend_Mail_Transport_Abstract
$_from string From: address
$_headerEncoding string Encoding of Mail headers
$_headers array Mail headers
$_messageId string Message-ID: header
$_mimeBoundary string MIME boundary string
$_recipients array Array of all recipients
$_replyTo string Reply-To header
$_returnPath string Return-Path header
$_subject string Subject: header
$_to array To: addresses
$_type string Content type of the message

공개 메소드들

메소드 설명
__construct ( string $charset = null ) Public constructor
addAttachment ( Zend_Mime_Part $attachment ) : Zend_Mail Adds an existing attachment to the mail message
addBcc ( string | array $email ) : Zend_Mail Adds Bcc recipient, $email can be an array, or a single string address
addCc ( string | array $email, string $name = '' ) : Zend_Mail Adds Cc-header and recipient, $email can be an array, or a single string address
addHeader ( string $name, string $value, boolean $append = false ) : Zend_Mail Add a custom header to the message
addTo ( string | array $email, string $name = '' ) : Zend_Mail Adds To-header and recipient, $email can be an array, or a single string address
clearDate ( ) : Zend_Mail Clears the formatted date from the message
clearDefaultFrom ( ) : void Clears the default sender from the mail
clearDefaultReplyTo ( ) : void Clears the default ReplyTo-address and -name from the mail
clearDefaultTransport ( ) Clear the default transport property
clearFrom ( ) : Zend_Mail Clears the sender from the mail
clearHeader ( string $headerName ) : Zend_Mail Clear header from the message
clearMessageId ( ) : Zend_Mail Clears the Message-ID from the message
clearRecipients ( ) : Zend_Mail Clears list of recipient email addresses
clearReplyTo ( ) : Zend_Mail Clears the current Reply-To address from the message
clearReturnPath ( ) : Zend_Mail Clears the current Return-Path address from the message
clearSubject ( ) : Zend_Mail Clears the encoded subject from the message
createAttachment ( string $body, string $mimeType = Zend_Mime::TYPE_OCTETSTREAM, string $disposition = Zend_Mime::DISPOSITION_ATTACHMENT, string $encoding = Zend_Mime::ENCODING_BASE64, string $filename = null ) : Zend_Mime_Part Creates a Zend_Mime_Part attachment
createMessageId ( ) : string Creates the Message-ID
getBodyHtml ( boolean $htmlOnly = false ) : false | Zend_Mime_Part | string Return Zend_Mime_Part representing body HTML
getBodyText ( boolean $textOnly = false ) : false | Zend_Mime_Part | string Return text body Zend_Mime_Part or string
getCharset ( ) : string Return charset string
getDate ( ) : string Returns the formatted date of the message
getDefaultFrom ( ) : null | array Returns the default sender of the mail
getDefaultReplyTo ( ) : null | array Returns the default Reply-To Address and Name of the mail
getDefaultTransport ( ) Gets the default mail transport for all following uses of unittests
getEncodingOfHeaders ( ) : string Return encoding of mail headers
getFrom ( ) : string Returns the sender of the mail
getHeaderEncoding ( ) : string Return the encoding of mail headers
getHeaders ( ) : array Return mail headers
getMessageId ( ) : string Returns the Message-ID of the message
getMimeBoundary ( ) : string Return the boundary string used for the message
getPartCount ( ) : integer Return a count of message parts
getRecipients ( ) : array Return list of recipient email addresses
getReplyTo ( ) : string | null Returns the current Reply-To address of the message
getReturnPath ( ) : string Returns the current Return-Path address of the message
getSubject ( ) : string Returns the encoded subject of the message
getType ( ) : string Get content type of the message
send ( Zend_Mail_Transport_Abstract $transport = null ) : Zend_Mail Sends this email using the given transport or a previously set DefaultTransport or the internal mail function if no default transport had been set.
setBodyHtml ( string $html, string $charset = null, string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE ) : Zend_Mail Sets the HTML body for the message
setBodyText ( string $txt, string $charset = null, string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE ) : Zend_Mail Sets the text body for the message.
setDate ( integer | string | Zend_Date $date = null ) : Zend_Mail Sets Date-header
setDefaultFrom ( string $email, string $name = null ) : void Sets Default From-email and name of the message
setDefaultReplyTo ( string $email, string $name = null ) : void Sets Default ReplyTo-address and -name of the message
setDefaultTransport ( Zend_Mail_Transport_Abstract $transport ) Sets the default mail transport for all following uses of Zend_Mail::send();
setEncodingOfHeaders ( string $encoding ) : Zend_Mail Set the encoding of mail headers
setFrom ( string $email, string $name = null ) : Zend_Mail Sets From-header and sender of the message
setFromToDefaultFrom ( ) : Zend_Mail Sets From-name and -email based on the defaults
setHeaderEncoding ( string $encoding ) : Zend_Mail Set the encoding of mail headers
setMessageId ( boolean | string $id = true ) : Zend_Mail Sets the Message-ID of the message
setMimeBoundary ( string $boundary ) : Zend_Mail Set an arbitrary mime boundary for the message
setReplyTo ( string $email, string $name = null ) : Zend_Mail Set Reply-To Header
setReplyToFromDefault ( ) : Zend_Mail Sets ReplyTo-name and -email based on the defaults
setReturnPath ( string $email ) : Zend_Mail Sets the Return-Path header of the message
setSubject ( string $subject ) : Zend_Mail Sets the subject of the message
setType ( string $type ) : Zend_Mail Set content type

보호된 메소드들

메소드 설명
_addRecipientAndHeader ( string $headerName, string $email, string $name ) Helper function for adding a recipient and the corresponding header
_clearHeader ( string $headerName ) Clear header from the message
_encodeHeader ( string $value ) : string Encode header fields
_filterEmail ( string $email ) : string Filter of email data
_filterName ( string $name ) : string Filter of name data
_filterOther ( string $data ) : string Filter of other data
_formatAddress ( string $email, string $name ) : string Formats e-mail address
_storeHeader ( string $headerName, string $value, boolean $append = false ) Add a header to the message

메소드 상세

__construct() 공개 메소드

Public constructor
public __construct ( string $charset = null )
$charset string

_addRecipientAndHeader() 보호된 메소드

Helper function for adding a recipient and the corresponding header
protected _addRecipientAndHeader ( string $headerName, string $email, string $name )
$headerName string
$email string
$name string

_clearHeader() 보호된 메소드

Clear header from the message
사용 중단: use public method directly
protected _clearHeader ( string $headerName )
$headerName string

_encodeHeader() 보호된 메소드

Encodes header content according to RFC1522 if it contains non-printable characters.
protected _encodeHeader ( string $value ) : string
$value string
리턴 string

_filterEmail() 보호된 메소드

Filter of email data
protected _filterEmail ( string $email ) : string
$email string
리턴 string

_filterName() 보호된 메소드

Filter of name data
protected _filterName ( string $name ) : string
$name string
리턴 string

_filterOther() 보호된 메소드

Filter of other data
protected _filterOther ( string $data ) : string
$data string
리턴 string

_formatAddress() 보호된 메소드

Formats e-mail address
protected _formatAddress ( string $email, string $name ) : string
$email string
$name string
리턴 string

_storeHeader() 보호된 메소드

Adds a header to this message. If append is true and the header already exists, raises a flag indicating that the header should be appended.
protected _storeHeader ( string $headerName, string $value, boolean $append = false )
$headerName string
$value string
$append boolean

addAttachment() 공개 메소드

Adds an existing attachment to the mail message
public addAttachment ( Zend_Mime_Part $attachment ) : Zend_Mail
$attachment Zend_Mime_Part
리턴 Zend_Mail Provides fluent interface

addBcc() 공개 메소드

Adds Bcc recipient, $email can be an array, or a single string address
public addBcc ( string | array $email ) : Zend_Mail
$email string | array
리턴 Zend_Mail Provides fluent interface

addCc() 공개 메소드

Adds Cc-header and recipient, $email can be an array, or a single string address
public addCc ( string | array $email, string $name = '' ) : Zend_Mail
$email string | array
$name string
리턴 Zend_Mail Provides fluent interface

addHeader() 공개 메소드

Add a custom header to the message
public addHeader ( string $name, string $value, boolean $append = false ) : Zend_Mail
$name string
$value string
$append boolean
리턴 Zend_Mail Provides fluent interface

addTo() 공개 메소드

Adds To-header and recipient, $email can be an array, or a single string address
public addTo ( string | array $email, string $name = '' ) : Zend_Mail
$email string | array
$name string
리턴 Zend_Mail Provides fluent interface

clearDate() 공개 메소드

Clears the formatted date from the message
public clearDate ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

clearDefaultFrom() 공개 정적인 메소드

Clears the default sender from the mail
public static clearDefaultFrom ( ) : void
리턴 void

clearDefaultReplyTo() 공개 정적인 메소드

Clears the default ReplyTo-address and -name from the mail
public static clearDefaultReplyTo ( ) : void
리턴 void

clearDefaultTransport() 공개 정적인 메소드

Clear the default transport property
public static clearDefaultTransport ( )

clearFrom() 공개 메소드

Clears the sender from the mail
public clearFrom ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

clearHeader() 공개 메소드

Clear header from the message
public clearHeader ( string $headerName ) : Zend_Mail
$headerName string
리턴 Zend_Mail Provides fluent inter

clearMessageId() 공개 메소드

Clears the Message-ID from the message
public clearMessageId ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

clearRecipients() 공개 메소드

Clears list of recipient email addresses
public clearRecipients ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

clearReplyTo() 공개 메소드

Clears the current Reply-To address from the message
public clearReplyTo ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

clearReturnPath() 공개 메소드

Clears the current Return-Path address from the message
public clearReturnPath ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

clearSubject() 공개 메소드

Clears the encoded subject from the message
public clearSubject ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

createAttachment() 공개 메소드

Attachment is automatically added to the mail object after creation. The attachment object is returned to allow for further manipulation.
public createAttachment ( string $body, string $mimeType = Zend_Mime::TYPE_OCTETSTREAM, string $disposition = Zend_Mime::DISPOSITION_ATTACHMENT, string $encoding = Zend_Mime::ENCODING_BASE64, string $filename = null ) : Zend_Mime_Part
$body string
$mimeType string
$disposition string
$encoding string
$filename string OPTIONAL A filename for the attachment
리턴 Zend_Mime_Part Newly created Zend_Mime_Part object (to allow advanced settings)

createMessageId() 공개 메소드

Creates the Message-ID
public createMessageId ( ) : string
리턴 string

getBodyHtml() 공개 메소드

Return Zend_Mime_Part representing body HTML
public getBodyHtml ( boolean $htmlOnly = false ) : false | Zend_Mime_Part | string
$htmlOnly boolean Whether to return the body HTML only, or the MIME part; defaults to false, the MIME part
리턴 false | Zend_Mime_Part | string

getBodyText() 공개 메소드

Return text body Zend_Mime_Part or string
public getBodyText ( boolean $textOnly = false ) : false | Zend_Mime_Part | string
$textOnly boolean Whether to return just the body text content or the MIME part; defaults to false, the MIME part
리턴 false | Zend_Mime_Part | string

getCharset() 공개 메소드

Return charset string
public getCharset ( ) : string
리턴 string

getDate() 공개 메소드

Returns the formatted date of the message
public getDate ( ) : string
리턴 string

getDefaultFrom() 공개 정적인 메소드

Returns the default sender of the mail
public static getDefaultFrom ( ) : null | array
리턴 null | array Null if none was set.

getDefaultReplyTo() 공개 정적인 메소드

Returns the default Reply-To Address and Name of the mail
public static getDefaultReplyTo ( ) : null | array
리턴 null | array Null if none was set.

getDefaultTransport() 공개 정적인 메소드

Gets the default mail transport for all following uses of unittests
public static getDefaultTransport ( )

getEncodingOfHeaders() 공개 메소드

Return encoding of mail headers
사용 중단: use {@link getHeaderEncoding()} instead
public getEncodingOfHeaders ( ) : string
리턴 string

getFrom() 공개 메소드

Returns the sender of the mail
public getFrom ( ) : string
리턴 string

getHeaderEncoding() 공개 메소드

Either Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
public getHeaderEncoding ( ) : string
리턴 string

getHeaders() 공개 메소드

Return mail headers
public getHeaders ( ) : array
리턴 array

getMessageId() 공개 메소드

Returns the Message-ID of the message
public getMessageId ( ) : string
리턴 string

getMimeBoundary() 공개 메소드

Return the boundary string used for the message
public getMimeBoundary ( ) : string
리턴 string

getPartCount() 공개 메소드

Return a count of message parts
public getPartCount ( ) : integer
리턴 integer

getRecipients() 공개 메소드

Return list of recipient email addresses
public getRecipients ( ) : array
리턴 array (of strings)

getReplyTo() 공개 메소드

Returns the current Reply-To address of the message
public getReplyTo ( ) : string | null
리턴 string | null Reply-To address, null when not set

getReturnPath() 공개 메소드

If no Return-Path header is set, returns the value of {@link $_from}.
public getReturnPath ( ) : string
리턴 string

getSubject() 공개 메소드

Returns the encoded subject of the message
public getSubject ( ) : string
리턴 string

getType() 공개 메소드

Get content type of the message
public getType ( ) : string
리턴 string

send() 공개 메소드

Sends this email using the given transport or a previously set DefaultTransport or the internal mail function if no default transport had been set.
public send ( Zend_Mail_Transport_Abstract $transport = null ) : Zend_Mail
$transport Zend_Mail_Transport_Abstract
리턴 Zend_Mail Provides fluent interface

setBodyHtml() 공개 메소드

Sets the HTML body for the message
public setBodyHtml ( string $html, string $charset = null, string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE ) : Zend_Mail
$html string
$charset string
$encoding string
리턴 Zend_Mail Provides fluent interface

setBodyText() 공개 메소드

Sets the text body for the message.
public setBodyText ( string $txt, string $charset = null, string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE ) : Zend_Mail
$txt string
$charset string
$encoding string
리턴 Zend_Mail Provides fluent interface

setDate() 공개 메소드

Sets Date-header
public setDate ( integer | string | Zend_Date $date = null ) : Zend_Mail
$date integer | string | Zend_Date
리턴 Zend_Mail Provides fluent interface

setDefaultFrom() 공개 정적인 메소드

Sets Default From-email and name of the message
public static setDefaultFrom ( string $email, string $name = null ) : void
$email string
$name string optional
리턴 void

setDefaultReplyTo() 공개 정적인 메소드

Sets Default ReplyTo-address and -name of the message
public static setDefaultReplyTo ( string $email, string $name = null ) : void
$email string
$name string optional
리턴 void

setDefaultTransport() 공개 정적인 메소드

Sets the default mail transport for all following uses of Zend_Mail::send();
public static setDefaultTransport ( Zend_Mail_Transport_Abstract $transport )
$transport Zend_Mail_Transport_Abstract

setEncodingOfHeaders() 공개 메소드

Set the encoding of mail headers
사용 중단: Use {@link setHeaderEncoding()} instead.
public setEncodingOfHeaders ( string $encoding ) : Zend_Mail
$encoding string
리턴 Zend_Mail

setFrom() 공개 메소드

Sets From-header and sender of the message
public setFrom ( string $email, string $name = null ) : Zend_Mail
$email string
$name string
리턴 Zend_Mail Provides fluent interface

setFromToDefaultFrom() 공개 메소드

Sets From-name and -email based on the defaults
public setFromToDefaultFrom ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

setHeaderEncoding() 공개 메소드

Set the encoding of mail headers
public setHeaderEncoding ( string $encoding ) : Zend_Mail
$encoding string Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
리턴 Zend_Mail Provides fluent interface

setMessageId() 공개 메소드

Sets the Message-ID of the message
public setMessageId ( boolean | string $id = true ) : Zend_Mail
$id boolean | string true :Auto false :No set null :No set string:Sets given string (Angle brackets is not necessary)
리턴 Zend_Mail Provides fluent interface

setMimeBoundary() 공개 메소드

If not set, Zend_Mime will generate one.
public setMimeBoundary ( string $boundary ) : Zend_Mail
$boundary string
리턴 Zend_Mail Provides fluent interface

setReplyTo() 공개 메소드

Set Reply-To Header
public setReplyTo ( string $email, string $name = null ) : Zend_Mail
$email string
$name string
리턴 Zend_Mail

setReplyToFromDefault() 공개 메소드

Sets ReplyTo-name and -email based on the defaults
public setReplyToFromDefault ( ) : Zend_Mail
리턴 Zend_Mail Provides fluent interface

setReturnPath() 공개 메소드

Sets the Return-Path header of the message
public setReturnPath ( string $email ) : Zend_Mail
$email string
리턴 Zend_Mail Provides fluent interface

setSubject() 공개 메소드

Sets the subject of the message
public setSubject ( string $subject ) : Zend_Mail
$subject string
리턴 Zend_Mail Provides fluent interface

setType() 공개 메소드

Should only be used for manually setting multipart content types.
public setType ( string $type ) : Zend_Mail
$type string Content type
리턴 Zend_Mail Implements fluent interface

프로퍼티 상세

$_bodyHtml 보호되어 있는 프로퍼티

text/html MIME part
protected false|Zend_Mime_Part $_bodyHtml
리턴 false | Zend_Mime_Part

$_bodyText 보호되어 있는 프로퍼티

text/plain MIME part
protected false|Zend_Mime_Part $_bodyText
리턴 false | Zend_Mime_Part

$_charset 보호되어 있는 프로퍼티

Mail character set
protected string $_charset
리턴 string

$_date 보호되어 있는 프로퍼티

Date: header
protected string $_date
리턴 string

$_defaultFrom 보호되어 있는 정적으로 프로퍼티

protected static array $_defaultFrom
리턴 array

$_defaultReplyTo 보호되어 있는 정적으로 프로퍼티

protected static array $_defaultReplyTo
리턴 array

$_defaultTransport 보호되어 있는 정적으로 프로퍼티

protected static Zend_Mail_Transport_Abstract $_defaultTransport
리턴 Zend_Mail_Transport_Abstract

$_from 보호되어 있는 프로퍼티

From: address
protected string $_from
리턴 string

$_headerEncoding 보호되어 있는 프로퍼티

Encoding of Mail headers
protected string $_headerEncoding
리턴 string

$_headers 보호되어 있는 프로퍼티

Mail headers
protected array $_headers
리턴 array

$_messageId 보호되어 있는 프로퍼티

Message-ID: header
protected string $_messageId
리턴 string

$_mimeBoundary 보호되어 있는 프로퍼티

MIME boundary string
protected string $_mimeBoundary
리턴 string

$_recipients 보호되어 있는 프로퍼티

Array of all recipients
protected array $_recipients
리턴 array

$_replyTo 보호되어 있는 프로퍼티

Reply-To header
protected string $_replyTo
리턴 string

$_returnPath 보호되어 있는 프로퍼티

Return-Path header
protected string $_returnPath
리턴 string

$_subject 보호되어 있는 프로퍼티

Subject: header
protected string $_subject
리턴 string

$_to 보호되어 있는 프로퍼티

To: addresses
protected array $_to
리턴 array

$_type 보호되어 있는 프로퍼티

Content type of the message
protected string $_type
리턴 string

$hasAttachments 공개적으로 프로퍼티

Flag: whether or not email has attachments
public bool $hasAttachments
리턴 boolean