EC-CUBE
Public メソッド | 変数
クラス Mail_mime

Public メソッド

 Mail_mime ($params=array())
 setParam ($name, $value)
 getParam ($name)
 setTXTBody ($data, $isfile=false, $append=false)
 getTXTBody ()
 setHTMLBody ($data, $isfile=false)
 getHTMLBody ()
 addHTMLImage ($file, $c_type='application/octet-stream', $name= '', $isfile=true, $content_id=null)
 addAttachment ($file, $c_type= 'application/octet-stream', $name= '', $isfile=true, $encoding= 'base64', $disposition= 'attachment', $charset= '', $language= '', $location= '', $n_encoding=null, $f_encoding=null, $description= '', $h_charset=null)
_file2str ($file_name)
_addTextPart (&$obj, $text)
_addHtmlPart (&$obj)
_addMixedPart ()
_addAlternativePart (&$obj)
_addRelatedPart (&$obj)
_addHtmlImagePart (&$obj, $value)
_addAttachmentPart (&$obj, $value)
 getMessage ($separation=null, $params=null, $headers=null, $overwrite=false)
 getMessageBody ($params=null)
 saveMessage ($filename, $params=null, $headers=null, $overwrite=false)
 saveMessageBody ($filename, $params=null)
get ($params=null, $filename=null, $skip_head=false)
headers ($xtra_headers=null, $overwrite=false, $skip_content=false)
 txtHeaders ($xtra_headers=null, $overwrite=false, $skip_content=false)
 setContentType ($type, $params=array())
 setSubject ($subject)
 setFrom ($email)
 addTo ($email)
 addCc ($email)
 addBcc ($email)
 encodeRecipients ($recipients)
 _encodeHeaders ($input, $params=array())
 encodeHeader ($name, $value, $charset, $encoding)
 _basename ($filename)
 _contentHeaders ()
 _checkParams ()

変数

 $_txtbody
 $_htmlbody
 $_html_images = array()
 $_parts = array()
 $_headers = array()
 $_build_params

関数

& _addAlternativePart ( &$  obj)

Adds a multipart/alternative part to a mimePart object (or creates one), and returns it during the build process.

引数:
mixed&$objThe object to add the part to, or null if a new object is to be created.
戻り値:
object The multipart/mixed mimePart object private
& _addAttachmentPart ( &$  obj,
value 
)

Adds an attachment subpart to a mimePart object and returns it during the build process.

引数:
object&$objThe mimePart to add the image to
array$valueThe attachment information
戻り値:
object The image mimePart object private
& _addHtmlImagePart ( &$  obj,
value 
)

Adds an html image subpart to a mimePart object and returns it during the build process.

引数:
object&$objThe mimePart to add the image to
array$valueThe image information
戻り値:
object The image mimePart object private
& _addHtmlPart ( &$  obj)

Adds a html subpart to the mimePart object and returns it during the build process.

引数:
mixed&$objThe object to add the part to, or null if a new object is to be created.
戻り値:
object The html mimePart object private

Creates a new mimePart object, using multipart/mixed as the initial content-type and returns it during the build process.

戻り値:
object The multipart/mixed mimePart object private
& _addRelatedPart ( &$  obj)

Adds a multipart/related part to a mimePart object (or creates one), and returns it during the build process.

引数:
mixed&$objThe object to add the part to, or null if a new object is to be created
戻り値:
object The multipart/mixed mimePart object private
& _addTextPart ( &$  obj,
text 
)

Adds a text subpart to the mimePart object and returns it during the build process.

引数:
mixed&$objThe object to add the part to, or null if a new object is to be created.
string$textThe text to add.
戻り値:
object The text mimePart object private
_basename ( filename)

Get file's basename (locale independent)

引数:
string$filenameFilename
戻り値:
string Basename private

Validate and set build parameters

戻り値:
void private

Get Content-Type and Content-Transfer-Encoding headers of the message

戻り値:
array Headers array private
_encodeHeaders ( input,
params = array() 
)

Encodes headers as per RFC2047

引数:
array$inputThe header data to encode
array$paramsExtra build parameters
戻り値:
array Encoded data private
& _file2str ( file_name)

Get the contents of the given file name as string

引数:
string$file_namePath of file to process
戻り値:
string Contents of $file_name private
addAttachment ( file,
c_type = 'application/octet-stream',
name = '',
isfile = true,
encoding = 'base64',
disposition = 'attachment',
charset = '',
language = '',
location = '',
n_encoding = null,
f_encoding = null,
description = '',
h_charset = null 
)

Adds a file to the list of attachments.

引数:
string$fileThe file name of the file to attach or the file contents itself
string$c_typeThe content type
string$nameThe filename of the attachment Only use if $file is the contents
bool$isfileWhether $file is a filename or not. Defaults to true
string$encodingThe type of encoding to use. Defaults to base64. Possible values: 7bit, 8bit, base64 or quoted-printable.
string$dispositionThe content-disposition of this file Defaults to attachment. Possible values: attachment, inline.
string$charsetThe character set of attachment's content.
string$languageThe language of the attachment
string$locationThe RFC 2557.4 location of the attachment
string$n_encodingEncoding of the attachment's name in Content-Type By default filenames are encoded using RFC2231 method Here you can set RFC2047 encoding (quoted-printable or base64) instead
string$f_encodingEncoding of the attachment's filename in Content-Disposition header.
string$descriptionContent-Description header
string$h_charsetThe character set of the headers e.g. filename If not specified, $charset will be used
戻り値:
mixed True on success or PEAR_Error object public
addBcc ( email)

Add an email to the Bcc (blank carbon copy) header (multiple calls to this method are allowed)

引数:
string$emailThe email direction to add
戻り値:
void public
addCc ( email)

Add an email to the Cc (carbon copy) header (multiple calls to this method are allowed)

引数:
string$emailThe email direction to add
戻り値:
void public
addHTMLImage ( file,
c_type = 'application/octet-stream',
name = '',
isfile = true,
content_id = null 
)

Adds an image to the list of embedded images.

引数:
string$fileThe image file name OR image data itself
string$c_typeThe content type
string$nameThe filename of the image. Only used if $file is the image data.
bool$isfileWhether $file is a filename or not. Defaults to true
string$content_idDesired Content-ID of MIME part Defaults to generated unique ID
戻り値:
bool True on success public
addTo ( email)

Add an email to the To header (multiple calls to this method are allowed)

引数:
string$emailThe email direction to add
戻り値:
void public
encodeHeader ( name,
value,
charset,
encoding 
)

Encodes a header as per RFC2047

引数:
string$nameThe header name
string$valueThe header data to encode
string$charsetCharacter set name
string$encodingEncoding name (base64 or quoted-printable)
戻り値:
string Encoded header data (without a name) public
から:
1.5.3
encodeRecipients ( recipients)

Since the PHP send function requires you to specify recipients (To: header) separately from the other headers, the To: header is not properly encoded. To fix this, you can use this public method to encode your recipients before sending to the send function

引数:
string$recipientsA comma-delimited list of recipients
戻り値:
string Encoded data public
& get ( params = null,
filename = null,
skip_head = false 
)

Builds the multipart message from the list ($this->_parts) and returns the mime content.

引数:
array$paramsBuild parameters that change the way the email is built. Should be associative. See $_build_params.
resource$filenameOutput file where to save the message instead of returning it
boolean$skip_headTrue if you want to return/save only the message without headers
戻り値:
mixed The MIME message content string, null or PEAR error object public

Get message HTML body

戻り値:
string HTML body public
から:
1.6.0
getMessage ( separation = null,
params = null,
headers = null,
overwrite = false 
)

Returns the complete e-mail, ready to send using an alternative mail delivery method. Note that only the mailpart that is made with Mail_Mime is created. This means that, YOU WILL HAVE NO TO: HEADERS UNLESS YOU SET IT YOURSELF using the $headers parameter!

引数:
string$separationThe separation between these two parts.
array$paramsThe Build parameters passed to the &get() function. See &get for more info.
array$headersThe extra headers that should be passed to the &headers() function. See that function for more info.
bool$overwriteOverwrite the existing headers with new.
戻り値:
mixed The complete e-mail or PEAR error object public
getMessageBody ( params = null)

Returns the complete e-mail body, ready to send using an alternative mail delivery method.

引数:
array$paramsThe Build parameters passed to the &get() function. See &get for more info.
戻り値:
mixed The e-mail body or PEAR error object public
から:
1.6.0
getParam ( name)

Get build parameter value

引数:
string$nameParameter name
戻り値:
mixed Parameter value public
から:
1.6.0

Get message text body

戻り値:
string Text body public
から:
1.6.0
& headers ( xtra_headers = null,
overwrite = false,
skip_content = false 
)

Returns an array with the headers needed to prepend to the email (MIME-Version and Content-Type). Format of argument is: $array['header-name'] = 'header-value';

引数:
array$xtra_headersAssoc array with any extra headers (optional) (Don't set Content-Type for multipart messages here!)
bool$overwriteOverwrite already existing headers.
bool$skip_contentDon't return content headers: Content-Type, Content-Disposition and Content-Transfer-Encoding
戻り値:
array Assoc array with the mime headers public
Mail_mime ( params = array())

Constructor function

引数:
mixed$paramsBuild parameters that change the way the email is built. Should be an associative array. See $_build_params.
戻り値:
void public
saveMessage ( filename,
params = null,
headers = null,
overwrite = false 
)

Writes (appends) the complete e-mail into file.

引数:
string$filenameOutput file location
array$paramsThe Build parameters passed to the &get() function. See &get for more info.
array$headersThe extra headers that should be passed to the &headers() function. See that function for more info.
bool$overwriteOverwrite the existing headers with new.
戻り値:
mixed True or PEAR error object public
から:
1.6.0
saveMessageBody ( filename,
params = null 
)

Writes (appends) the complete e-mail body into file.

引数:
string$filenameOutput file location
array$paramsThe Build parameters passed to the &get() function. See &get for more info.
戻り値:
mixed True or PEAR error object public
から:
1.6.0
setContentType ( type,
params = array() 
)

Sets message Content-Type header. Use it to build messages with various content-types e.g. miltipart/raport not supported by _contentHeaders() function.

引数:
string$typeType name
array$paramsHash array of header parameters
戻り値:
void public
から:
1.7.0
setFrom ( email)

Set an email to the From (the sender) header

引数:
string$emailThe email address to use
戻り値:
void public
setHTMLBody ( data,
isfile = false 
)

Adds a html part to the mail.

引数:
string$dataEither a string or the file name with the contents
bool$isfileA flag that determines whether $data is a filename, or a string(false, default)
戻り値:
bool True on success public
setParam ( name,
value 
)

Set build parameter value

引数:
string$nameParameter name
string$valueParameter value
戻り値:
void public
から:
1.6.0
setSubject ( subject)

Sets the Subject header

引数:
string$subjectString to set the subject to.
戻り値:
void public
setTXTBody ( data,
isfile = false,
append = false 
)

Accessor function to set the body text. Body text is used if it's not an html mail being sent or else is used to fill the text/plain part that emails clients who don't support html should show.

引数:
string$dataEither a string or the file name with the contents
bool$isfileIf true the first param should be treated as a file name, else as a string (default)
bool$appendIf true the text or file is appended to the existing body, else the old body is overwritten
戻り値:
mixed True on success or PEAR_Error object public
txtHeaders ( xtra_headers = null,
overwrite = false,
skip_content = false 
)

Get the text version of the headers (usefull if you want to use the PHP mail() function)

引数:
array$xtra_headersAssoc array with any extra headers (optional) (Don't set Content-Type for multipart messages here!)
bool$overwriteOverwrite the existing headers with new.
bool$skip_contentDon't return content headers: Content-Type, Content-Disposition and Content-Transfer-Encoding
戻り値:
string Plain text headers public

構造体

$_build_params
初期値:
 array(
        
        
        'head_encoding' => 'quoted-printable',
        
        
        'text_encoding' => 'quoted-printable',
        
        
        'html_encoding' => 'quoted-printable',
        
        'html_charset'  => 'ISO-8859-1',
        
        'text_charset'  => 'ISO-8859-1',
        
        'head_charset'  => 'ISO-8859-1',
        
        'eol'           => "\r\n",
        
        'delay_file_io' => false
    )

このクラスの説明は次のファイルから生成されました:
 全て データ構造 ネームスペース 関数 変数