My Project
 All Data Structures Namespaces Functions Variables
Public Member Functions | Data Fields | Protected Member Functions
CI_Email Class Reference

Public Member Functions

 __construct ($config=array())
 
 initialize ($config=array())
 
 clear ($clear_attachments=FALSE)
 
 from ($from, $name= '')
 
 reply_to ($replyto, $name= '')
 
 to ($to)
 
 cc ($cc)
 
 bcc ($bcc, $limit= '')
 
 subject ($subject)
 
 message ($body)
 
 attach ($filename, $disposition= 'attachment')
 
 set_alt_message ($str= '')
 
 set_mailtype ($type= 'text')
 
 set_wordwrap ($wordwrap=TRUE)
 
 set_protocol ($protocol= 'mail')
 
 set_priority ($n=3)
 
 set_newline ($newline="\n")
 
 set_crlf ($crlf="\n")
 
 validate_email ($email)
 
 valid_email ($address)
 
 clean_email ($email)
 
 word_wrap ($str, $charlim= '')
 
 send ()
 
 batch_bcc_send ()
 
 print_debugger ()
 

Data Fields

 $useragent = "CodeIgniter"
 
 $mailpath = "/usr/sbin/sendmail"
 
 $protocol = "mail"
 
 $smtp_host = ""
 
 $smtp_user = ""
 
 $smtp_pass = ""
 
 $smtp_port = "25"
 
 $smtp_timeout = 5
 
 $smtp_crypto = ""
 
 $wordwrap = TRUE
 
 $wrapchars = "76"
 
 $mailtype = "text"
 
 $charset = "utf-8"
 
 $multipart = "mixed"
 
 $alt_message = ''
 
 $validate = FALSE
 
 $priority = "3"
 
 $newline = "\n"
 
 $crlf = "\n"
 
 $send_multipart = TRUE
 
 $bcc_batch_mode = FALSE
 
 $bcc_batch_size = 200
 
 $_safe_mode = FALSE
 
 $_subject = ""
 
 $_body = ""
 
 $_finalbody = ""
 
 $_alt_boundary = ""
 
 $_atc_boundary = ""
 
 $_header_str = ""
 
 $_smtp_connect = ""
 
 $_encoding = "8bit"
 
 $_IP = FALSE
 
 $_smtp_auth = FALSE
 
 $_replyto_flag = FALSE
 
 $_debug_msg = array()
 
 $_recipients = array()
 
 $_cc_array = array()
 
 $_bcc_array = array()
 
 $_headers = array()
 
 $_attach_name = array()
 
 $_attach_type = array()
 
 $_attach_disp = array()
 
 $_protocols = array('mail', 'sendmail', 'smtp')
 
 $_base_charsets = array('us-ascii', 'iso-2022-')
 
 $_bit_depths = array('7bit', '8bit')
 
 $_priorities = array('1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)')
 

Protected Member Functions

 _set_header ($header, $value)
 
 _str_to_array ($email)
 
 _set_boundaries ()
 
 _get_message_id ()
 
 _get_protocol ($return=TRUE)
 
 _get_encoding ($return=TRUE)
 
 _get_content_type ()
 
 _set_date ()
 
 _get_mime_message ()
 
 _get_alt_message ()
 
 _build_headers ()
 
 _write_headers ()
 
 _build_message ()
 
 _prep_quoted_printable ($str, $charlim= '')
 
 _prep_q_encoding ($str, $from=FALSE)
 
 _unwrap_specials ()
 
 _remove_nl_callback ($matches)
 
 _spool_email ()
 
 _send_with_mail ()
 
 _send_with_sendmail ()
 
 _send_with_smtp ()
 
 _smtp_connect ()
 
 _send_command ($cmd, $data= '')
 
 _smtp_authenticate ()
 
 _send_data ($data)
 
 _get_smtp_data ()
 
 _get_hostname ()
 
 _get_ip ()
 
 _set_error_message ($msg, $val= '')
 
 _mime_types ($ext="")
 

Constructor & Destructor Documentation

__construct (   $config = array())

Constructor - Sets Email Preferences

The constructor can be passed an array of config values

Member Function Documentation

_build_headers ( )
protected

Build final headers

protected

Parameters
string
Returns
string
_build_message ( )
protected

Build Final Body and attachments

protected

Returns
void
_get_alt_message ( )
protected

Build alternative plain text message

This public function provides the raw message for use in plain-text headers of HTML-formatted emails. If the user hasn't specified his own alternative message it creates one by stripping the HTML

protected

Returns
string
_get_content_type ( )
protected

Get content type (text/html/attachment)

protected

Returns
string
_get_encoding (   $return = TRUE)
protected

Get Mail Encoding

protected

Parameters
bool
Returns
string
_get_hostname ( )
protected

Get Hostname

protected

Returns
string
_get_ip ( )
protected

Get IP

protected

Returns
string
_get_message_id ( )
protected

Get the Message ID

protected

Returns
string
_get_mime_message ( )
protected

Mime message

protected

Returns
string
_get_protocol (   $return = TRUE)
protected

Get Mail Protocol

protected

Parameters
bool
Returns
string
_get_smtp_data ( )
protected

Get SMTP data

protected

Returns
string
_mime_types (   $ext = "")
protected

Mime Types

protected

Parameters
string
Returns
string
_prep_q_encoding (   $str,
  $from = FALSE 
)
protected

Prep Q Encoding

Performs "Q Encoding" on a string for use in email headers. It's related but not identical to quoted-printable, so it has its own method

public

Parameters
str
bool// set to TRUE for processing From: headers
Returns
str
_prep_quoted_printable (   $str,
  $charlim = '' 
)
protected

Prep Quoted Printable

Prepares string for Quoted-Printable Content-Transfer-Encoding Refer to RFC 2045 http://www.ietf.org/rfc/rfc2045.txt

protected

Parameters
string
integer
Returns
string
_remove_nl_callback (   $matches)
protected

Strip line-breaks via callback

protected

Returns
string
_send_command (   $cmd,
  $data = '' 
)
protected

Send SMTP command

protected

Parameters
string
string
Returns
string
_send_data (   $data)
protected

Send SMTP data

protected

Returns
bool
_send_with_mail ( )
protected

Send using mail()

protected

Returns
bool
_send_with_sendmail ( )
protected

Send using Sendmail

protected

Returns
bool
_send_with_smtp ( )
protected

Send using SMTP

protected

Returns
bool
_set_boundaries ( )
protected

Set Message Boundary

protected

Returns
void
_set_date ( )
protected

Set RFC 822 Date

protected

Returns
string
_set_error_message (   $msg,
  $val = '' 
)
protected

Set Message

protected

Parameters
string
Returns
string
_set_header (   $header,
  $value 
)
protected

Add a Header Item

protected

Parameters
string
string
Returns
void
_smtp_authenticate ( )
protected

SMTP Authenticate

protected

Returns
bool
_smtp_connect ( )
protected

SMTP Connect

protected

Parameters
string
Returns
string
_spool_email ( )
protected

Spool mail to the mail server

protected

Returns
bool
_str_to_array (   $email)
protected

Convert a String to an Array

protected

Parameters
string
Returns
array
_unwrap_specials ( )
protected

Unwrap special elements

protected

Returns
void
_write_headers ( )
protected

Write Headers as a string

protected

Returns
void
attach (   $filename,
  $disposition = 'attachment' 
)

Assign file attachments

public

Parameters
string
Returns
void
batch_bcc_send ( )

Batch Bcc Send. Sends groups of BCCs in batches

public

Returns
bool
bcc (   $bcc,
  $limit = '' 
)

Set BCC

public

Parameters
string
string
Returns
void
cc (   $cc)

Set CC

public

Parameters
string
Returns
void
clean_email (   $email)

Clean Extended Email Address: Joe Smith joe@s.nosp@m.mith.nosp@m..com

public

Parameters
string
Returns
string
clear (   $clear_attachments = FALSE)

Initialize the Email Data

public

Returns
void
from (   $from,
  $name = '' 
)

Set FROM

public

Parameters
string
string
Returns
void
initialize (   $config = array())

Initialize preferences

public

Parameters
array
Returns
void
message (   $body)

Set Body

public

Parameters
string
Returns
void
print_debugger ( )

Get Debug Message

public

Returns
string
reply_to (   $replyto,
  $name = '' 
)

Set Reply-to

public

Parameters
string
string
Returns
void
send ( )

Send Email

public

Returns
bool
set_alt_message (   $str = '')

Set Multipart Value

public

Parameters
string
Returns
void
set_crlf (   $crlf = "\n")

Set CRLF

public

Parameters
string
Returns
void
set_mailtype (   $type = 'text')

Set Mailtype

public

Parameters
string
Returns
void
set_newline (   $newline = "\n")

Set Newline Character

public

Parameters
string
Returns
void
set_priority (   $n = 3)

Set Priority

public

Parameters
integer
Returns
void
set_protocol (   $protocol = 'mail')

Set Protocol

public

Parameters
string
Returns
void
set_wordwrap (   $wordwrap = TRUE)

Set Wordwrap

public

Parameters
string
Returns
void
subject (   $subject)

Set Email Subject

public

Parameters
string
Returns
void
to (   $to)

Set Recipients

public

Parameters
string
Returns
void
valid_email (   $address)

Email Validation

public

Parameters
string
Returns
bool
validate_email (   $email)

Validate Email Address

public

Parameters
string
Returns
bool
word_wrap (   $str,
  $charlim = '' 
)

Word Wrap

public

Parameters
string
integer
Returns
string

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