SmartHome
 All Data Structures Files Functions Variables
PHPMailer Class Reference

Public Member Functions

 IsHTML ($bool)
 
 IsSMTP ()
 
 IsMail ()
 
 IsSendmail ()
 
 IsQmail ()
 
 AddAddress ($address, $name= '')
 
 AddCC ($address, $name= '')
 
 AddBCC ($address, $name= '')
 
 AddReplyTo ($address, $name= '')
 
 Send ()
 
 SendmailSend ($header, $body)
 
 MailSend ($header, $body)
 
 SmtpSend ($header, $body)
 
 SmtpConnect ()
 
 SmtpClose ()
 
 SetLanguage ($lang_type, $lang_path= 'language/')
 
 AddrAppend ($type, $addr)
 
 AddrFormat ($addr)
 
 WrapText ($message, $length, $qp_mode=false)
 
 UTF8CharBoundary ($encodedText, $maxLength)
 
 SetWordWrap ()
 
 CreateHeader ()
 
 GetMailMIME ()
 
 CreateBody ()
 
 GetBoundary ($boundary, $charSet, $contentType, $encoding)
 
 EndBoundary ($boundary)
 
 SetMessageType ()
 
 HeaderLine ($name, $value)
 
 TextLine ($value)
 
 AddAttachment ($path, $name= '', $encoding= 'base64', $type= 'application/octet-stream')
 
 AttachAll ()
 
 EncodeFile ($path, $encoding= 'base64')
 
 EncodeString ($str, $encoding= 'base64')
 
 EncodeHeader ($str, $position= 'text')
 
 HasMultiBytes ($str)
 
 Base64EncodeWrapMB ($str)
 
 EncodeQP ($input= '', $line_max=76, $space_conv=false)
 
 EncodeQ ($str, $position= 'text')
 
 AddStringAttachment ($string, $filename, $encoding= 'base64', $type= 'application/octet-stream')
 
 AddEmbeddedImage ($path, $cid, $name= '', $encoding= 'base64', $type= 'application/octet-stream')
 
 InlineImageExists ()
 
 ClearAddresses ()
 
 ClearCCs ()
 
 ClearBCCs ()
 
 ClearReplyTos ()
 
 ClearAllRecipients ()
 
 ClearAttachments ()
 
 ClearCustomHeaders ()
 
 SetError ($msg)
 
 RFCDate ()
 
 ServerVar ($varName)
 
 ServerHostname ()
 
 Lang ($key)
 
 IsError ()
 
 FixEOL ($str)
 
 AddCustomHeader ($custom_header)
 
 MsgHTML ($message, $basedir='')
 
 _mime_types ($ext= '')
 
 set ($name, $value= '')
 
 getFile ($filename)
 
 SecureHeader ($str)
 
 Sign ($cert_filename, $key_filename, $key_pass)
 

Data Fields

 $Priority = 3
 
 $CharSet = 'iso-8859-1'
 
 $ContentType = 'text/plain'
 
 $Encoding = '8bit'
 
 $ErrorInfo = ''
 
 $From = 'abdullahbayraktar9@gmail.com'
 
 $FromName = 'Admin'
 
 $Sender = ''
 
 $Subject = ''
 
 $Body = ''
 
 $AltBody = ''
 
 $WordWrap = 0
 
 $Mailer = 'mail'
 
 $Sendmail = '/usr/sbin/sendmail'
 
 $PluginDir = ''
 
 $Version = "2.0.4"
 
 $ConfirmReadingTo = ''
 
 $Hostname = ''
 
 $MessageID = ''
 
 $Host = 'localhost'
 
 $Port = 25
 
 $Helo = ''
 
 $SMTPSecure = ""
 
 $SMTPAuth = false
 
 $Username = 'abdullahbayraktar9'
 
 $Password = ''
 
 $Timeout = 10
 
 $SMTPDebug = false
 
 $SMTPKeepAlive = false
 
 $SingleTo = false
 
 $smtp = NULL
 
 $to = array()
 
 $cc = array()
 
 $bcc = array()
 
 $ReplyTo = array()
 
 $attachment = array()
 
 $CustomHeader = array()
 
 $message_type = ''
 
 $boundary = array()
 
 $language = array()
 
 $error_count = 0
 
 $LE = "\n"
 
 $sign_cert_file = ""
 
 $sign_key_file = ""
 
 $sign_key_pass = ""
 

Member Function Documentation

_mime_types (   $ext = '')

Gets the mime type of the embedded or inline image private

Returns
mime type of ext
AddAddress (   $address,
  $name = '' 
)

Adds a "To" address.

Parameters
string$address
string$name
Returns
void
AddAttachment (   $path,
  $name = '',
  $encoding = 'base64',
  $type = 'application/octet-stream' 
)

Adds an attachment from a path on the filesystem. Returns false if the file could not be found or accessed.

Parameters
string$pathPath to the attachment.
string$nameOverrides the attachment name.
string$encodingFile encoding (see $Encoding).
string$typeFile extension (MIME) type.
Returns
bool
AddBCC (   $address,
  $name = '' 
)

Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

Parameters
string$address
string$name
Returns
void
AddCC (   $address,
  $name = '' 
)

Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

Parameters
string$address
string$name
Returns
void
AddCustomHeader (   $custom_header)

Adds a custom header.

Returns
void
AddEmbeddedImage (   $path,
  $cid,
  $name = '',
  $encoding = 'base64',
  $type = 'application/octet-stream' 
)

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".

Parameters
string$pathPath to the attachment.
string$cidContent ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
string$nameOverrides the attachment name.
string$encodingFile encoding (see $Encoding).
string$typeFile extension (MIME) type.
Returns
bool
AddrAppend (   $type,
  $addr 
)

Creates recipient headers. private

Returns
string
AddReplyTo (   $address,
  $name = '' 
)

Adds a "Reply-To" address.

Parameters
string$address
string$name
Returns
void
AddrFormat (   $addr)

Formats an address correctly. private

Returns
string
AddStringAttachment (   $string,
  $filename,
  $encoding = 'base64',
  $type = 'application/octet-stream' 
)

Adds a string or binary attachment (non-filesystem) to the list. This method can be used to attach ascii or binary data, such as a BLOB record from a database.

Parameters
string$stringString attachment data.
string$filenameName of the attachment.
string$encodingFile encoding (see $Encoding).
string$typeFile extension (MIME) type.
Returns
void
AttachAll ( )

Attaches all fs, string, and binary attachments to the message. Returns an empty string on failure. private

Returns
string
Base64EncodeWrapMB (   $str)

Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character. Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php private

Parameters
string$strmulti-byte text to wrap encode
Returns
string
ClearAddresses ( )

Clears all recipients assigned in the TO array. Returns void.

Returns
void
ClearAllRecipients ( )

Clears all recipients assigned in the TO, CC and BCC array. Returns void.

Returns
void
ClearAttachments ( )

Clears all previously set filesystem, string, and binary attachments. Returns void.

Returns
void
ClearBCCs ( )

Clears all recipients assigned in the BCC array. Returns void.

Returns
void
ClearCCs ( )

Clears all recipients assigned in the CC array. Returns void.

Returns
void
ClearCustomHeaders ( )

Clears all custom headers. Returns void.

Returns
void
ClearReplyTos ( )

Clears all recipients assigned in the ReplyTo array. Returns void.

Returns
void
CreateBody ( )

Assembles the message body. Returns an empty string on failure. private

Returns
string
CreateHeader ( )

Assembles message header. private

Returns
string
EncodeFile (   $path,
  $encoding = 'base64' 
)

Encodes attachment in requested format. Returns an empty string on failure. private

Returns
string
EncodeHeader (   $str,
  $position = 'text' 
)

Encode a header string to best of Q, B, quoted or none. private

Returns
string
EncodeQ (   $str,
  $position = 'text' 
)

Encode string to q encoding. private

Returns
string
EncodeQP (   $input = '',
  $line_max = 76,
  $space_conv = false 
)

Encode string to quoted-printable. private

Returns
string
EncodeString (   $str,
  $encoding = 'base64' 
)

Encodes string to requested format. Returns an empty string on failure. private

Returns
string
EndBoundary (   $boundary)

Returns the end of a message boundary. private

FixEOL (   $str)

Changes every end of line from CR or LF to CRLF. private

Returns
string
GetBoundary (   $boundary,
  $charSet,
  $contentType,
  $encoding 
)

Returns the start of a message boundary. private

getFile (   $filename)

Read a file from a supplied filename and return it.

public

Parameters
string$filenameParameter File Name
GetMailMIME ( )

Returns the message MIME. private

Returns
string
HasMultiBytes (   $str)

Checks if a string contains multibyte characters. private

Parameters
string$strmulti-byte text to wrap encode
Returns
bool
HeaderLine (   $name,
  $value 
)
InlineImageExists ( )

Returns true if an inline attachment is present. private

Returns
bool
IsError ( )

Returns true if an error occurred.

Returns
bool
IsHTML (   $bool)

Sets message type to HTML.

Parameters
bool$bool
Returns
void
IsMail ( )

Sets Mailer to send message using PHP mail() function.

Returns
void
IsQmail ( )

Sets Mailer to send message using the qmail MTA.

Returns
void
IsSendmail ( )

Sets Mailer to send message using the $Sendmail program.

Returns
void
IsSMTP ( )

Sets Mailer to send message using SMTP.

Returns
void
Lang (   $key)

Returns a message in the appropriate language. private

Returns
string
MailSend (   $header,
  $body 
)

Sends mail using the PHP mail() function. private

Returns
bool
MsgHTML (   $message,
  $basedir = '' 
)

Evaluates the message and returns modifications for inline images and backgrounds public

Returns
$message
RFCDate ( )

Returns the proper RFC 822 formatted date. private

Returns
string
SecureHeader (   $str)

Strips newlines to prevent header injection. private

Parameters
string$strString
Returns
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.

Returns
bool
SendmailSend (   $header,
  $body 
)

Sends mail using the $Sendmail program. private

Returns
bool
ServerHostname ( )

Returns the server hostname or 'localhost.localdomain' if unknown. private

Returns
string
ServerVar (   $varName)

Returns the appropriate server variable. Should work with both PHP 4.1.0+ as well as older versions. Returns an empty string if nothing is found. private

Returns
mixed
set (   $name,
  $value = '' 
)

Set (or reset) Class Objects (variables)

Usage Example: $page->set('X-Priority', '3');

public

Parameters
string$nameParameter Name
mixed$valueParameter Value NOTE: will not work with arrays, there are no arrays to set/reset
SetError (   $msg)

Adds the error message to the error container. Returns void. private

Returns
void
SetLanguage (   $lang_type,
  $lang_path = 'language/' 
)

Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.

Parameters
string$lang_typeType of language (e.g. Portuguese: "br")
string$lang_pathPath to the language file directory public
Returns
bool
SetMessageType ( )

Sets the message type. private

Returns
void
SetWordWrap ( )

Set the body wrapping. private

Returns
void
Sign (   $cert_filename,
  $key_filename,
  $key_pass 
)

Set the private key file and password to sign the message.

public

Parameters
string$key_filenameParameter File Name
string$key_passPassword for private key
SmtpClose ( )

Closes the active SMTP session if one exists.

Returns
void
SmtpConnect ( )

Initiates a connection to an SMTP server. Returns false if the operation failed. private

Returns
bool
SmtpSend (   $header,
  $body 
)

Sends mail via SMTP using PhpSMTP (Author: Chris Ryan). Returns bool. Returns false if there is a bad MAIL FROM, RCPT, or DATA input. private

Returns
bool
TextLine (   $value)

Returns a formatted mail line. private

Returns
string
UTF8CharBoundary (   $encodedText,
  $maxLength 
)

Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string. Original written by Colin Brown. private

Parameters
string$encodedTextutf-8 QP text
int$maxLengthfind last character boundary prior to this length
Returns
int
WrapText (   $message,
  $length,
  $qp_mode = false 
)

Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable. Original written by philippe. private

Returns
string

Field Documentation

$AltBody = ''
$attachment = array()
$bcc = array()
$Body = ''
$boundary = array()
$cc = array()
$CharSet = 'iso-8859-1'
$ConfirmReadingTo = ''
$ContentType = 'text/plain'
$CustomHeader = array()
$Encoding = '8bit'
$error_count = 0
$ErrorInfo = ''
$From = 'abdullahbayraktar9@gmail.com'
$FromName = 'Admin'
$Helo = ''
$Host = 'localhost'
$Hostname = ''
$language = array()
$LE = "\n"
$Mailer = 'mail'
$message_type = ''
$MessageID = ''
$Password = ''
$PluginDir = ''
$Port = 25
$Priority = 3
$ReplyTo = array()
$Sender = ''
$Sendmail = '/usr/sbin/sendmail'
$sign_cert_file = ""
$sign_key_file = ""
$sign_key_pass = ""
$SingleTo = false
$smtp = NULL
$SMTPAuth = false
$SMTPDebug = false
$SMTPKeepAlive = false
$SMTPSecure = ""
$Subject = ''
$Timeout = 10
$to = array()
$Username = 'abdullahbayraktar9'
$Version = "2.0.4"
$WordWrap = 0

The documentation for this class was generated from the following file: