PHP 클래스 SlightPHP\PHPMailer

파일 보기 프로젝트 열기: hetao29/slightphp

공개 프로퍼티들

프로퍼티 타입 설명
$AltBody string Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body.
$Body string If HTML then run IsHTML(true).
$CharSet string Sets the CharSet of the message.
$ConfirmReadingTo string Sets the email address that a reading confirmation will be sent.
$ContentType string Sets the Content-type of the message.
$Encoding string Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
$ErrorInfo string Holds the most recent mailer error message.
$From string Sets the From email address for the message.
$FromName string Sets the From name of the message.
$Helo string Sets the SMTP HELO of the message (Default is $Hostname).
$Host string Hosts will be tried in order.
$Hostname string Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'.
$Mailer string Method to send mail: ("mail", "sendmail", or "smtp").
$MessageID string If empty, a unique id will be generated.
$Password string Sets SMTP password.
$PluginDir string Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.
$Port integer Sets the default SMTP server port.
$Priority integer Email priority (1 = High, 3 = Normal, 5 = low).
$SMTPAuth boolean Sets SMTP authentication. Utilizes the Username and Password variables.
$SMTPDebug boolean Sets SMTP class debugging on or off.
$SMTPKeepAlive boolean Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().
$SMTPSecure string Options are "", "ssl" or "tls"
$Sender string Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
$Sendmail string Sets the path of the sendmail program.
$SingleTo boolean Provides the ability to have the TO field process individual emails, instead of sending to entire TO addresses
$Subject string Sets the Subject of the message.
$Timeout integer Sets the SMTP server timeout in seconds. This function will not work with the win32 version.
$Username string Sets SMTP username.
$Version string Holds PHPMailer version.
$WordWrap integer Sets word wrapping on the body of the message to a given number of characters.

공개 메소드들

메소드 설명
AddAddress ( string $address, string $name = '' ) : void Adds a "To" address.
AddAttachment ( string $path, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' ) : boolean Adds an attachment from a path on the filesystem.
AddBCC ( string $address, string $name = '' ) : void Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
AddCC ( string $address, string $name = '' ) : void Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
AddCustomHeader ( $custom_header ) : void Adds a custom header.
AddEmbeddedImage ( string $path, string $cid, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' ) : boolean Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
AddReplyTo ( string $address, string $name = '' ) : void Adds a "Reply-to" address.
AddStringAttachment ( string $string, string $filename, string $encoding = 'base64', string $type = 'application/octet-stream' ) : void Adds a string or binary attachment (non-filesystem) to the list.
AddrAppend ( $type, $addr ) : string Creates recipient headers.
AddrFormat ( $addr ) : string Formats an address correctly.
AttachAll ( ) : string Attaches all fs, string, and binary attachments to the message.
Base64EncodeWrapMB ( string $str ) : string Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character.
ClearAddresses ( ) : void Clears all recipients assigned in the TO array. Returns void.
ClearAllRecipients ( ) : void Clears all recipients assigned in the TO, CC and BCC array. Returns void.
ClearAttachments ( ) : void Clears all previously set filesystem, string, and binary attachments. Returns void.
ClearBCCs ( ) : void Clears all recipients assigned in the BCC array. Returns void.
ClearCCs ( ) : void Clears all recipients assigned in the CC array. Returns void.
ClearCustomHeaders ( ) : void Clears all custom headers. Returns void.
ClearReplyTos ( ) : void Clears all recipients assigned in the ReplyTo array. Returns void.
CreateBody ( ) : string Assembles the message body. Returns an empty string on failure.
CreateHeader ( ) : string Assembles message header.
EncodeFile ( $path, $encoding = 'base64' ) : string Encodes attachment in requested format. Returns an empty string on failure.
EncodeHeader ( $str, $position = 'text' ) : string Encode a header string to best of Q, B, quoted or none.
EncodeQ ( $str, $position = 'text' ) : string Encode string to q encoding.
EncodeQP ( $input = '', integer $line_max = 76, $space_conv = false ) : string Encode string to quoted-printable.
EncodeString ( $str, $encoding = 'base64' ) : string Encodes string to requested format. Returns an empty string on failure.
EndBoundary ( $boundary ) Returns the end of a message boundary.
GetBoundary ( $boundary, $charSet, $contentType, $encoding ) Returns the start of a message boundary.
GetMailMIME ( ) : string Returns the message MIME.
HasMultiBytes ( string $str ) : boolean Checks if a string contains multibyte characters.
HeaderLine ( $name, $value ) * Returns a formatted header line.
InlineImageExists ( ) : boolean Returns true if an inline attachment is present.
IsError ( ) : boolean Returns true if an error occurred.
IsHTML ( boolean $bool ) : void Sets message type to HTML.
IsMail ( ) : void Sets Mailer to send message using PHP mail() function.
IsQmail ( ) : void Sets Mailer to send message using the qmail MTA.
IsSMTP ( ) : void Sets Mailer to send message using SMTP.
IsSendmail ( ) : void Sets Mailer to send message using the $Sendmail program.
MailSend ( $header, $body ) : boolean Sends mail using the PHP mail() function.
MsgHTML ( $message, $basedir = '' ) Evaluates the message and returns modifications for inline images and backgrounds
SecureHeader ( string $str ) : string Strips newlines to prevent header injection.
Send ( ) : boolean Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
SendmailSend ( $header, $body ) : boolean Sends mail using the $Sendmail program.
SetLanguage ( string $lang_type = 'en', string $lang_path = 'language/' ) : boolean Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.
SetMessageType ( ) : void Sets the message type.
SetWordWrap ( ) : void Set the body wrapping.
Sign ( $cert_filename, string $key_filename, string $key_pass ) Set the private key file and password to sign the message.
SmtpClose ( ) : void Closes the active SMTP session if one exists.
SmtpConnect ( ) : boolean Initiates a connection to an SMTP server. Returns false if the operation failed.
SmtpSend ( $header, $body ) : boolean Sends mail via SMTP using PhpSMTP (Author: Chris Ryan). Returns bool. Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
TextLine ( $value ) : string Returns a formatted mail line.
UTF8CharBoundary ( string $encodedText, integer $maxLength ) : integer Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string.
WrapText ( $message, $length, $qp_mode = false ) : string Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.
_mime_types ( $ext = '' ) : mime Gets the mime type of the embedded or inline image
getFile ( string $filename ) Read a file from a supplied filename and return it.
get_magic_quotes ( )
set ( string $name, mixed $value = '' ) Set (or reset) Class Objects (variables)

비공개 메소드들

메소드 설명
FixEOL ( $str ) : string Changes every end of line from CR or LF to CRLF.
Lang ( $key ) : string Returns a message in the appropriate language.
RFCDate ( ) : string Returns the proper RFC 822 formatted date.
ServerHostname ( ) : string Returns the server hostname or 'localhost.localdomain' if unknown.
SetError ( $msg ) : void Adds the error message to the error container.

메소드 상세

AddAddress() 공개 메소드

Adds a "To" address.
public AddAddress ( string $address, string $name = '' ) : void
$address string
$name string
리턴 void

AddAttachment() 공개 메소드

Returns false if the file could not be found or accessed.
public AddAttachment ( string $path, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' ) : boolean
$path string Path to the attachment.
$name string Overrides the attachment name.
$encoding string File encoding (see $Encoding).
$type string File extension (MIME) type.
리턴 boolean

AddBCC() 공개 메소드

Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
public AddBCC ( string $address, string $name = '' ) : void
$address string
$name string
리턴 void

AddCC() 공개 메소드

Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
public AddCC ( string $address, string $name = '' ) : void
$address string
$name string
리턴 void

AddCustomHeader() 공개 메소드

Adds a custom header.
public AddCustomHeader ( $custom_header ) : void
리턴 void

AddEmbeddedImage() 공개 메소드

Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
public AddEmbeddedImage ( string $path, string $cid, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' ) : boolean
$path string Path to the attachment.
$cid string Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
$name string Overrides the attachment name.
$encoding string File encoding (see $Encoding).
$type string File extension (MIME) type.
리턴 boolean

AddReplyTo() 공개 메소드

Adds a "Reply-to" address.
public AddReplyTo ( string $address, string $name = '' ) : void
$address string
$name string
리턴 void

AddStringAttachment() 공개 메소드

This method can be used to attach ascii or binary data, such as a BLOB record from a database.
public AddStringAttachment ( string $string, string $filename, string $encoding = 'base64', string $type = 'application/octet-stream' ) : void
$string string String attachment data.
$filename string Name of the attachment.
$encoding string File encoding (see $Encoding).
$type string File extension (MIME) type.
리턴 void

AddrAppend() 공개 메소드

Creates recipient headers.
public AddrAppend ( $type, $addr ) : string
리턴 string

AddrFormat() 공개 메소드

Formats an address correctly.
public AddrFormat ( $addr ) : string
리턴 string

AttachAll() 공개 메소드

Returns an empty string on failure.
public AttachAll ( ) : string
리턴 string

Base64EncodeWrapMB() 공개 메소드

Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
public Base64EncodeWrapMB ( string $str ) : string
$str string multi-byte text to wrap encode
리턴 string

ClearAddresses() 공개 메소드

Clears all recipients assigned in the TO array. Returns void.
public ClearAddresses ( ) : void
리턴 void

ClearAllRecipients() 공개 메소드

Clears all recipients assigned in the TO, CC and BCC array. Returns void.
public ClearAllRecipients ( ) : void
리턴 void

ClearAttachments() 공개 메소드

Clears all previously set filesystem, string, and binary attachments. Returns void.
public ClearAttachments ( ) : void
리턴 void

ClearBCCs() 공개 메소드

Clears all recipients assigned in the BCC array. Returns void.
public ClearBCCs ( ) : void
리턴 void

ClearCCs() 공개 메소드

Clears all recipients assigned in the CC array. Returns void.
public ClearCCs ( ) : void
리턴 void

ClearCustomHeaders() 공개 메소드

Clears all custom headers. Returns void.
public ClearCustomHeaders ( ) : void
리턴 void

ClearReplyTos() 공개 메소드

Clears all recipients assigned in the ReplyTo array. Returns void.
public ClearReplyTos ( ) : void
리턴 void

CreateBody() 공개 메소드

Assembles the message body. Returns an empty string on failure.
public CreateBody ( ) : string
리턴 string

CreateHeader() 공개 메소드

Assembles message header.
public CreateHeader ( ) : string
리턴 string

EncodeFile() 공개 메소드

Encodes attachment in requested format. Returns an empty string on failure.
public EncodeFile ( $path, $encoding = 'base64' ) : string
리턴 string

EncodeHeader() 공개 메소드

Encode a header string to best of Q, B, quoted or none.
public EncodeHeader ( $str, $position = 'text' ) : string
리턴 string

EncodeQ() 공개 메소드

Encode string to q encoding.
public EncodeQ ( $str, $position = 'text' ) : string
리턴 string

EncodeQP() 공개 메소드

Encode string to quoted-printable.
public EncodeQP ( $input = '', integer $line_max = 76, $space_conv = false ) : string
$line_max integer Number of chars allowed on a line before wrapping
리턴 string

EncodeString() 공개 메소드

Encodes string to requested format. Returns an empty string on failure.
public EncodeString ( $str, $encoding = 'base64' ) : string
리턴 string

EndBoundary() 공개 메소드

Returns the end of a message boundary.
public EndBoundary ( $boundary )

GetBoundary() 공개 메소드

Returns the start of a message boundary.
public GetBoundary ( $boundary, $charSet, $contentType, $encoding )

GetMailMIME() 공개 메소드

Returns the message MIME.
public GetMailMIME ( ) : string
리턴 string

HasMultiBytes() 공개 메소드

Checks if a string contains multibyte characters.
public HasMultiBytes ( string $str ) : boolean
$str string multi-byte text to wrap encode
리턴 boolean

HeaderLine() 공개 메소드

* Returns a formatted header line.
public HeaderLine ( $name, $value )

InlineImageExists() 공개 메소드

Returns true if an inline attachment is present.
public InlineImageExists ( ) : boolean
리턴 boolean

IsError() 공개 메소드

Returns true if an error occurred.
public IsError ( ) : boolean
리턴 boolean

IsHTML() 공개 메소드

Sets message type to HTML.
public IsHTML ( boolean $bool ) : void
$bool boolean
리턴 void

IsMail() 공개 메소드

Sets Mailer to send message using PHP mail() function.
public IsMail ( ) : void
리턴 void

IsQmail() 공개 메소드

Sets Mailer to send message using the qmail MTA.
public IsQmail ( ) : void
리턴 void

IsSMTP() 공개 메소드

Sets Mailer to send message using SMTP.
public IsSMTP ( ) : void
리턴 void

IsSendmail() 공개 메소드

Sets Mailer to send message using the $Sendmail program.
public IsSendmail ( ) : void
리턴 void

MailSend() 공개 메소드

Sends mail using the PHP mail() function.
public MailSend ( $header, $body ) : boolean
리턴 boolean

MsgHTML() 공개 메소드

Evaluates the message and returns modifications for inline images and backgrounds
public MsgHTML ( $message, $basedir = '' )

SecureHeader() 공개 메소드

Strips newlines to prevent header injection.
public SecureHeader ( string $str ) : string
$str string String
리턴 string

Send() 공개 메소드

Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
public Send ( ) : boolean
리턴 boolean

SendmailSend() 공개 메소드

Sends mail using the $Sendmail program.
public SendmailSend ( $header, $body ) : boolean
리턴 boolean

SetLanguage() 공개 메소드

Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.
public SetLanguage ( string $lang_type = 'en', string $lang_path = 'language/' ) : boolean
$lang_type string Type of language (e.g. Portuguese: "br")
$lang_path string Path to the language file directory
리턴 boolean

SetMessageType() 공개 메소드

Sets the message type.
public SetMessageType ( ) : void
리턴 void

SetWordWrap() 공개 메소드

Set the body wrapping.
public SetWordWrap ( ) : void
리턴 void

Sign() 공개 메소드

Set the private key file and password to sign the message.
public Sign ( $cert_filename, string $key_filename, string $key_pass )
$key_filename string Parameter File Name
$key_pass string Password for private key

SmtpClose() 공개 메소드

Closes the active SMTP session if one exists.
public SmtpClose ( ) : void
리턴 void

SmtpConnect() 공개 메소드

Initiates a connection to an SMTP server. Returns false if the operation failed.
public SmtpConnect ( ) : boolean
리턴 boolean

SmtpSend() 공개 메소드

Sends mail via SMTP using PhpSMTP (Author: Chris Ryan). Returns bool. Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
public SmtpSend ( $header, $body ) : boolean
리턴 boolean

TextLine() 공개 메소드

Returns a formatted mail line.
public TextLine ( $value ) : string
리턴 string

UTF8CharBoundary() 공개 메소드

Original written by Colin Brown.
public UTF8CharBoundary ( string $encodedText, integer $maxLength ) : integer
$encodedText string utf-8 QP text
$maxLength integer find last character boundary prior to this length
리턴 integer

WrapText() 공개 메소드

Original written by philippe.
public WrapText ( $message, $length, $qp_mode = false ) : string
리턴 string

_mime_types() 공개 메소드

Gets the mime type of the embedded or inline image
public _mime_types ( $ext = '' ) : mime
리턴 mime type of ext

getFile() 공개 메소드

Read a file from a supplied filename and return it.
public getFile ( string $filename )
$filename string Parameter File Name

get_magic_quotes() 공개 메소드

public get_magic_quotes ( )

set() 공개 메소드

Usage Example: $page->set('X-Priority', '3');
public set ( string $name, mixed $value = '' )
$name string Parameter Name
$value mixed Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset

프로퍼티 상세

$AltBody 공개적으로 프로퍼티

Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body.
public string $AltBody
리턴 string

$Body 공개적으로 프로퍼티

If HTML then run IsHTML(true).
public string $Body
리턴 string

$CharSet 공개적으로 프로퍼티

Sets the CharSet of the message.
public string $CharSet
리턴 string

$ConfirmReadingTo 공개적으로 프로퍼티

Sets the email address that a reading confirmation will be sent.
public string $ConfirmReadingTo
리턴 string

$ContentType 공개적으로 프로퍼티

Sets the Content-type of the message.
public string $ContentType
리턴 string

$Encoding 공개적으로 프로퍼티

Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
public string $Encoding
리턴 string

$ErrorInfo 공개적으로 프로퍼티

Holds the most recent mailer error message.
public string $ErrorInfo
리턴 string

$From 공개적으로 프로퍼티

Sets the From email address for the message.
public string $From
리턴 string

$FromName 공개적으로 프로퍼티

Sets the From name of the message.
public string $FromName
리턴 string

$Helo 공개적으로 프로퍼티

Sets the SMTP HELO of the message (Default is $Hostname).
public string $Helo
리턴 string

$Host 공개적으로 프로퍼티

Hosts will be tried in order.
public string $Host
리턴 string

$Hostname 공개적으로 프로퍼티

Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'.
public string $Hostname
리턴 string

$Mailer 공개적으로 프로퍼티

Method to send mail: ("mail", "sendmail", or "smtp").
public string $Mailer
리턴 string

$MessageID 공개적으로 프로퍼티

If empty, a unique id will be generated.
public string $MessageID
리턴 string

$Password 공개적으로 프로퍼티

Sets SMTP password.
public string $Password
리턴 string

$PluginDir 공개적으로 프로퍼티

Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.
public string $PluginDir
리턴 string

$Port 공개적으로 프로퍼티

Sets the default SMTP server port.
public int $Port
리턴 integer

$Priority 공개적으로 프로퍼티

Email priority (1 = High, 3 = Normal, 5 = low).
public int $Priority
리턴 integer

$SMTPAuth 공개적으로 프로퍼티

Sets SMTP authentication. Utilizes the Username and Password variables.
public bool $SMTPAuth
리턴 boolean

$SMTPDebug 공개적으로 프로퍼티

Sets SMTP class debugging on or off.
public bool $SMTPDebug
리턴 boolean

$SMTPKeepAlive 공개적으로 프로퍼티

Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().
public bool $SMTPKeepAlive
리턴 boolean

$SMTPSecure 공개적으로 프로퍼티

Options are "", "ssl" or "tls"
public string $SMTPSecure
리턴 string

$Sender 공개적으로 프로퍼티

Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
public string $Sender
리턴 string

$Sendmail 공개적으로 프로퍼티

Sets the path of the sendmail program.
public string $Sendmail
리턴 string

$SingleTo 공개적으로 프로퍼티

Provides the ability to have the TO field process individual emails, instead of sending to entire TO addresses
public bool $SingleTo
리턴 boolean

$Subject 공개적으로 프로퍼티

Sets the Subject of the message.
public string $Subject
리턴 string

$Timeout 공개적으로 프로퍼티

Sets the SMTP server timeout in seconds. This function will not work with the win32 version.
public int $Timeout
리턴 integer

$Username 공개적으로 프로퍼티

Sets SMTP username.
public string $Username
리턴 string

$Version 공개적으로 프로퍼티

Holds PHPMailer version.
public string $Version
리턴 string

$WordWrap 공개적으로 프로퍼티

Sets word wrapping on the body of the message to a given number of characters.
public int $WordWrap
리턴 integer