Class mSmtp

Description

Helper Class for SMTP e-mails sending

  • author: Pascal (Meta) Havelange (havelangep@gmail.com)
  • copyright: © 2007 All rights reserved

Located in /lib/msmtp.inc.php (line 46)


	
			
Direct descendents
Class Description
EC_SMTP SMTP e-mail messaging, set on the European Commission's SMTP server
Class Constant Summary
Method Summary
static boolean testEmailAddress (string $address, [ $rfc_allowed_length = true], [ $rfc_allowed_characters = true])
mSmtp __construct ( $sender,  $smtp_address, [ $smtp_port = 25])
string addAttachment (string $file, [string $name = false], [string $mime_type = false], [boolean $isData = false], [string $cid = null])
void addBCC (array|string $bcc)
void addCC (array|string $cc)
void addRecipients (array|string $recipients)
void send ()
void setBCC (array|string $bcc)
void setCC (array|string $cc)
void setFrom (string $from_address)
void setMessage (string $content, [string $type = mSmtp::MMAIL_TYPE_HTML], [string $encoding = mSmtp::MMAIL_ENCODING_UTF8], [string $xfertEncoding = mSmtp::MMAIL_TRANSFER_ENCODING_8BIT])
void setPriority ([int $priority = mSmtp::MMAIL_PRIORITY_NORMAL])
void setRecipients (array|string $recipients)
void setReturnAddress (string $return_address)
void setSMTPServer ([string $smtp_address = "localhost"], [ $smtp_port = 25])
void setSubject (string $string)
Methods
static method testEmailAddress (line 517)

Test the format of an email address, according to RFC 2822 and 2821

static boolean testEmailAddress (string $address, [ $rfc_allowed_length = true], [ $rfc_allowed_characters = true])
  • string $address
  • $rfc_allowed_length
  • $rfc_allowed_characters
Constructor __construct (line 119)

Constructor

  • access: public
mSmtp __construct ( $sender,  $smtp_address, [ $smtp_port = 25])
  • $sender
  • $smtp_address
  • $smtp_port

Redefined in descendants as:
addAttachment (line 296)

Add an attachment to the message

  • return: The Attachment's ID. You can use it to embed the attachment in the body of your message, using the syntax <img src="cid:ATTACH_ID" />
  • final:
  • access: public
string addAttachment (string $file, [string $name = false], [string $mime_type = false], [boolean $isData = false], [string $cid = null])
  • string $file: Either the Full path to the file to attach, either the data to attach itself
  • string $name: Filename to use in the message
  • string $mime_type: Mime type of the file (if not set application/octet-stream will be used)
  • boolean $isData: Flag indicating if (when True) $file contains the data to attach, or (when false) if it is the path to a file to attach.
  • string $cid: Attachment identifier (If not provided, it will be automatically generated)
addBCC (line 232)

Add "blind carbon copy" recipients to the mail

  • final:
  • access: public
void addBCC (array|string $bcc)
  • array|string $bcc: The e-mail address of the recipient, or an array of email addresses to add
addCC (line 212)

Add "carbon copy" recipients to the mail

  • final:
  • access: public
void addCC (array|string $cc)
  • array|string $cc: The e-mail address of the recipient, or an array of email addresses to add
addRecipients (line 192)

Add recipients to the mail

  • final:
  • access: public
void addRecipients (array|string $recipients)
  • array|string $recipients: The e-mail address of the recipient, or an array of email addresses to add
send (line 347)

Send the message

  • final:
  • access: public
void send ()
setBCC (line 222)

Set the list of "blind carbon copy" recipients of the mail

  • final:
  • access: public
void setBCC (array|string $bcc)
  • array|string $bcc: The e-mail address of the recipient, or an array of email addresses
setCC (line 202)

Set the list of "carbon copy" recipients of the mail

  • final:
  • access: public
void setCC (array|string $cc)
  • array|string $cc: The e-mail address of the recipient, or an array of email addresses
setFrom (line 156)

Set the address from which this e-mail wiil be send

  • final:
  • access: public
void setFrom (string $from_address)
  • string $from_address: E-mail address the recipient will see as beeing the sender of this e-mail
setMessage (line 277)

Set the body of the message

void setMessage (string $content, [string $type = mSmtp::MMAIL_TYPE_HTML], [string $encoding = mSmtp::MMAIL_ENCODING_UTF8], [string $xfertEncoding = mSmtp::MMAIL_TRANSFER_ENCODING_8BIT])
  • string $content: Content of the message
  • string $type: Mime type of the message (default is MMAIL_TYPE_HTML)
  • string $encoding: Character encoding to use (default is MMAIL_ENCODING_UTF8)
  • string $xfertEncoding: Content-Transfer-Encoding to use (default is MMAIL_TRANSFER_ENCODING_8BIT)
setPriority (line 257)

Set the priority level of the message

void setPriority ([int $priority = mSmtp::MMAIL_PRIORITY_NORMAL])
  • int $priority: Message's priority
setRecipients (line 182)

Set the list of recipients of the mail

  • final:
  • access: public
void setRecipients (array|string $recipients)
  • array|string $recipients: The e-mail address of the recipient, or an array of email addresses
setReturnAddress (line 169)

Set the address that the receiver will have to use to reply to your mail (its mail client will then ignore the 'from' address)

  • final:
  • access: public
void setReturnAddress (string $return_address)
  • string $return_address: E-mail address the recipient should use to reply to the mail
setSMTPServer (line 145)

Set the SMTP Server Host

  • final:
  • access: public
void setSMTPServer ([string $smtp_address = "localhost"], [ $smtp_port = 25])
  • string $smtp_address: SMTP Server
  • $smtp_port
setSubject (line 242)

Set the subject of the message

  • final:
  • access: public
void setSubject (string $string)
  • string $string: The subject of the message
Class Constants
MMAIL_ENCODING_ISO88591 = "ISO-8859-1" (line 109)

< The mail's content encoding is utf-8

MMAIL_ENCODING_UTF8 = "UTF-8" (line 108)

< The mail's content type is gif

MMAIL_PRIORITY_HIGH = 2 (line 100)

< e-mail normal priority

MMAIL_PRIORITY_HIGHEST = 1 (line 101)

< e-mail high priority

MMAIL_PRIORITY_LOW = 4 (line 98)

< e-mail lowest priority

MMAIL_PRIORITY_LOWEST = 5 (line 97)
MMAIL_PRIORITY_NORMAL = 3 (line 99)

< e-mail low priority

MMAIL_TRANSFER_ENCODING_7BIT = "7bit" (line 112)

< The mail's encoding mechanism is '8 bit'

MMAIL_TRANSFER_ENCODING_8BIT = "8bit" (line 111)

< The mail's content encoding is ISO-8859-1

MMAIL_TRANSFER_ENCODING_BASE64 = "base64" (line 113)

< The mail's encoding mechanism is '7 bit'

MMAIL_TYPE_HTML = "text/html" (line 104)

< The mail's content type is text

MMAIL_TYPE_IMAGE_GIF = "image/gif" (line 106)

< The mail's content type is jpeg

MMAIL_TYPE_IMAGE_JPG = "image/jpg" (line 105)

< The mail's content type is HTML

MMAIL_TYPE_TEXT = "text/plain" (line 103)

< e-mail highest priority

Documentation generated on Thu, 10 Dec 2009 15:21:28 +0100 by phpDocumentor 1.4.1