PHP 클래스 Tools\Mailer\Email

상속: extends Cake\Mailer\Email, use trait Cake\Log\LogTrait
파일 보기 프로젝트 열기: dereuromark/cakephp-tools 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_debug boolean | null
$_error string | null
$_log array
$_priority integer | null
$_wrapLength integer | null

공개 메소드들

메소드 설명
__construct ( string | null $config = null )
addAttachment ( string $file, string | null $name = null, array $fileInfo = [] ) Add an attachment from file
addBlobAttachment ( string $content, string $filename, string | null $mimeType = null, array $fileInfo = [] ) Add an attachment as blob
addEmbeddedAttachment ( string $file, string | null $name = null, string | null $contentId = null, array $options = [] ) : string | $this Add an inline attachment from file
addEmbeddedBlobAttachment ( string $content, string $filename, string | null $mimeType = null, string | null $contentId = null, array $options = [] ) : string | $this Add an inline attachment as blob
attachments ( mixed | null $attachments = null ) : array | $this Overwrite to allow mimetype detection
getError ( ) : string Returns the error if existent
layout ( string | boolean $layout = false ) Change the layout
priority ( integer | null $priority = null ) : integer | $this Set/Get priority
profile ( mixed $config = null ) : string | null | $this Ovewrite to allow custom enhancements
reset ( ) : void EmailLib::resetAndSet()
send ( string | array | null $message = null ) : boolean Set the body of the mail as we send it.
validates ( ) : boolean Validate if the email has the required fields necessary to make send() work.
wrapLength ( integer | null $length = null ) : integer | $this Set/Get wrapLength

보호된 메소드들

메소드 설명
_attachFiles ( string | null $boundary = null ) : array Attach non-embedded files by adding file contents inside boundaries.
_attachInlineFiles ( string | null $boundary = null ) : array Attach inline/embedded files to the message.
_getMime ( string $filename, string $default = 'application/octet-stream' ) : string Try to find mimetype by file extension
_getMimeByExtension ( string $ext, string $default = 'application/octet-stream' ) : mixed
_isEmbeddedAttachment ( string $file, string $name ) : boolean | string Returns if this particular file has already been attached as embedded file with this exact name to prevent the same image to overwrite each other and also to only send this image once.
_isEmbeddedBlobAttachment ( string $content, string $name ) : boolean | string Returns if this particular file has already been attached as embedded file with this exact name to prevent the same image to overwrite each other and also to only send this image once.
_logEmail ( string $level = LogLevel::INFO ) : void
_readFile ( string $path ) : string Read the file contents and return a base64 version of the file contents.
_wrap ( string $message, integer $wrapLength = CakeEmail::LINE_LENGTH_MUST ) : array Fix line length

메소드 상세

__construct() 공개 메소드

public __construct ( string | null $config = null )
$config string | null

_attachFiles() 보호된 메소드

CUSTOM FIX: blob data support
protected _attachFiles ( string | null $boundary = null ) : array
$boundary string | null Boundary to use. If null, will default to $this->_boundary
리턴 array An array of lines to add to the message

_attachInlineFiles() 보호된 메소드

CUSTOM FIX: blob data support
protected _attachInlineFiles ( string | null $boundary = null ) : array
$boundary string | null Boundary to use. If null, will default to $this->_boundary
리턴 array An array of lines to add to the message

_getMime() 보호된 메소드

Try to find mimetype by file extension
protected _getMime ( string $filename, string $default = 'application/octet-stream' ) : string
$filename string File name
$default string default MimeType
리턴 string Mimetype (falls back to `application/octet-stream`)

_getMimeByExtension() 보호된 메소드

protected _getMimeByExtension ( string $ext, string $default = 'application/octet-stream' ) : mixed
$ext string
$default string
리턴 mixed

_isEmbeddedAttachment() 보호된 메소드

Allows multiple usage of the same embedded image (using the same cid)
protected _isEmbeddedAttachment ( string $file, string $name ) : boolean | string
$file string
$name string
리턴 boolean | string CID of the found file or false if no such attachment can be found

_isEmbeddedBlobAttachment() 보호된 메소드

Allows multiple usage of the same embedded image (using the same cid)
protected _isEmbeddedBlobAttachment ( string $content, string $name ) : boolean | string
$content string
$name string
리턴 boolean | string CID of the found file or false if no such attachment can be found

_logEmail() 보호된 메소드

protected _logEmail ( string $level = LogLevel::INFO ) : void
$level string
리턴 void

_readFile() 보호된 메소드

Overwrite parent to avoid File class and file_exists to false negative existent remove images. Also fixes file_get_contents (used via File class) to close the connection again after getting remote files. So far it would have kept the connection open in HTTP/1.1.
protected _readFile ( string $path ) : string
$path string The absolute path to the file to read.
리턴 string File contents in base64 encoding

_wrap() 보호된 메소드

Fix line length
protected _wrap ( string $message, integer $wrapLength = CakeEmail::LINE_LENGTH_MUST ) : array
$message string Message to wrap
$wrapLength integer
리턴 array Wrapped message

addAttachment() 공개 메소드

Add an attachment from file
public addAttachment ( string $file, string | null $name = null, array $fileInfo = [] )
$file string Absolute path
$name string | null
$fileInfo array

addBlobAttachment() 공개 메소드

Add an attachment as blob
public addBlobAttachment ( string $content, string $filename, string | null $mimeType = null, array $fileInfo = [] )
$content string Blob data
$filename string to attach it
$mimeType string | null (leave it empty to get mimetype from $filename)
$fileInfo array

addEmbeddedAttachment() 공개 메소드

Options: - mimetype - contentDisposition
public addEmbeddedAttachment ( string $file, string | null $name = null, string | null $contentId = null, array $options = [] ) : string | $this
$file string Absolute path
$name string | null (optional)
$contentId string | null (optional)
$options array Options
리턴 string | $this CID or $this

addEmbeddedBlobAttachment() 공개 메소드

Options: - contentDisposition
public addEmbeddedBlobAttachment ( string $content, string $filename, string | null $mimeType = null, string | null $contentId = null, array $options = [] ) : string | $this
$content string Blob data
$filename string to attach it
$mimeType string | null (leave it empty to get mimetype from $filename)
$contentId string | null (optional)
$options array Options
리턴 string | $this $contentId or $this

attachments() 공개 메소드

Overwrite to allow mimetype detection
public attachments ( mixed | null $attachments = null ) : array | $this
$attachments mixed | null
리턴 array | $this

getError() 공개 메소드

Returns the error if existent
public getError ( ) : string
리턴 string

layout() 공개 메소드

Change the layout
public layout ( string | boolean $layout = false )
$layout string | boolean Layout to use (or false to use none)

priority() 공개 메소드

Set/Get priority
public priority ( integer | null $priority = null ) : integer | $this
$priority integer | null 1 (highest) to 5 (lowest)
리턴 integer | $this

profile() 공개 메소드

Ovewrite to allow custom enhancements
public profile ( mixed $config = null ) : string | null | $this
$config mixed
리턴 string | null | $this

reset() 공개 메소드

EmailLib::resetAndSet()
public reset ( ) : void
리턴 void

send() 공개 메소드

Note: the text can be an array, each element will appear as a seperate line in the message body. Do NOT pass a message if you use $this->set() in combination with templates
public send ( string | array | null $message = null ) : boolean
$message string | array | null Message
리턴 boolean Success

validates() 공개 메소드

Assumes layouting (does not check on content to be present or if view/layout files are missing).
public validates ( ) : boolean
리턴 boolean Success

wrapLength() 공개 메소드

Set/Get wrapLength
public wrapLength ( integer | null $length = null ) : integer | $this
$length integer | null Must not be more than CakeEmail::LINE_LENGTH_MUST
리턴 integer | $this

프로퍼티 상세

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

protected bool|null $_debug
리턴 boolean | null

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

protected string|null $_error
리턴 string | null

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

protected array $_log
리턴 array

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

protected int|null $_priority
리턴 integer | null

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

protected int|null $_wrapLength
리턴 integer | null