nyroFwk  0.2
Public Member Functions | Protected Member Functions | Protected Attributes
helper_email Class Reference
Inheritance diagram for helper_email:
object

Public Member Functions

 to ($addr, $add=false)
 
 cc ($addr, $add=false)
 
 bcc ($addr, $add=false)
 
 addr ($addr, $type, $add=false)
 
 attach ($prm)
 
 send ()
 
 wrapText ($message, $qp_mode=false)
 
 fixEOL ($str)
 
 UTF8CharBoundary ($encodedText, $maxLength)
 
 __get ($name)
 
 __set ($name, $val)
 
 getAttr ($name)
 
 setAttr ($name, $value)
 
 getCfg ()
 

Protected Member Functions

 afterInit ()
 
 getBoundary ($ln=24)
 
 quotePrintable ($str)
 
 getBody (&$headers=null)
 
 encode ($val, $encoding=null)
 
 headerLine ($name, $val)
 
 textLine ($val)
 
 headerAddr (array $val)
 
 formatAddr ($addr)
 
 encodeHeader ($val)
 
 parseHtml ()
 
 beforeInit ()
 

Protected Attributes

 $attachment = array()
 
 $cfg
 

Detailed Description

Helper to send email

Definition at line 10 of file email.class.php.

Member Function Documentation

◆ __get()

__get (   $name)

Definition at line 648 of file email.class.php.

◆ __set()

__set (   $name,
  $val 
)

Definition at line 652 of file email.class.php.

◆ addr()

addr (   $addr,
  $type,
  $add = false 
)

Add an address

Parameters
string | array$addrEmail address
string$typeType (to, cc or bcc)
bool$addTrue to add instead of replacing

Definition at line 60 of file email.class.php.

◆ afterInit()

afterInit ( )
protected

Definition at line 19 of file email.class.php.

◆ attach()

attach (   $prm)

Attach a file

Parameters
string | array$prmFile path if string or array with key:
  • string file (required) File path name
  • string name File name
  • string type File Mime type
Returns
bool True if added (file exists)

Definition at line 80 of file email.class.php.

◆ bcc()

bcc (   $addr,
  $add = false 
)

Add a bcc address

Parameters
string | array$addrEmail address
bool$addTrue to add instead of replacing

Definition at line 49 of file email.class.php.

◆ beforeInit()

beforeInit ( )
protectedinherited

Call just before the configuration initialisation

Definition at line 35 of file object.class.php.

◆ cc()

cc (   $addr,
  $add = false 
)

Add a cc address

Parameters
string | array$addrEmail address
bool$addTrue to add instead of replacing

Definition at line 39 of file email.class.php.

◆ encode()

encode (   $val,
  $encoding = null 
)
protected

Encode a content regarding the encoding config

Parameters
string$val
null | string$encodingForce encoding type to use
Returns
string

Definition at line 405 of file email.class.php.

◆ encodeHeader()

encodeHeader (   $val)
protected

Encode header

Parameters
string$val
string$typeType of content (text or phrase)
Returns
string

Definition at line 614 of file email.class.php.

◆ fixEOL()

fixEOL (   $str)

Changes every end of line from CR or LF to CRLF

Returns
string

Definition at line 508 of file email.class.php.

◆ formatAddr()

formatAddr (   $addr)
protected

Format address

Parameters
string | array$addremail or array with email and name
Returns
string

Definition at line 597 of file email.class.php.

◆ getAttr()

getAttr (   $name)
inherited

Get an attribute

Parameters
string$nameAttribute name
Returns
mixed|null The attribute or null if not set

Definition at line 48 of file object.class.php.

◆ getBody()

getBody ( $headers = null)
protected

Get the body content

Parameters
string | null$headersHeader to edit or null to add the header in the email
Returns
string

Definition at line 297 of file email.class.php.

◆ getBoundary()

getBoundary (   $ln = 24)
protected

Create a random boundary

Returns
string

Definition at line 207 of file email.class.php.

◆ getCfg()

getCfg ( )
inherited

Get the configuration object

Returns
config

Definition at line 67 of file object.class.php.

◆ headerAddr()

headerAddr ( array  $val)
protected

Enter description here...

Parameters
unknown_type$name
array$val
Returns
unknown

Definition at line 583 of file email.class.php.

◆ headerLine()

headerLine (   $name,
  $val 
)
protected

Create the string to add in the header

Parameters
string$nameHeader name
mixed$valHeader value
Returns
string

Definition at line 562 of file email.class.php.

◆ parseHtml()

parseHtml ( )
protected

Render the HTML setting if it is set to used a tpl

Definition at line 643 of file email.class.php.

◆ quotePrintable()

quotePrintable (   $str)
protected

Quote a string to be included in a "printable" email part

Parameters
string$strThe string to quote
Returns
string

Definition at line 220 of file email.class.php.

◆ send()

send ( )

Send the email

Returns
bool True if successful

Definition at line 104 of file email.class.php.

◆ setAttr()

setAttr (   $name,
  $value 
)
inherited

Set an attribute

Parameters
string$nameAttribute name
mixed$valueAttribute value

Definition at line 58 of file object.class.php.

◆ textLine()

textLine (   $val)
protected

Create a text line with a crlf

Parameters
string$val
Returns
string

Definition at line 572 of file email.class.php.

◆ to()

to (   $addr,
  $add = false 
)

Add a to address

Parameters
string | array$addrEmail address
bool$addTrue to add instead of replacing

Definition at line 29 of file email.class.php.

◆ UTF8CharBoundary()

UTF8CharBoundary (   $encodedText,
  $maxLength 
)

Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string

Parameters
string$encodedTextUtf-8 QP text
int$maxLengthFind last character boundary prior to this length
Returns
int

Definition at line 523 of file email.class.php.

◆ wrapText()

wrapText (   $message,
  $qp_mode = false 
)

Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.

Parameters
string$messageThe message to wrap
boolean$qp_modeWhether to run in Quoted-Printable mode
Returns
string

Definition at line 428 of file email.class.php.

Field Documentation

◆ $attachment

$attachment = array()
protected

Definition at line 17 of file email.class.php.

◆ $cfg

$cfg
protectedinherited

Definition at line 17 of file object.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:21 for nyroFwk by doxygen 1.8.13