Overview

Namespaces

  • Sleepy
  • Module
    • Authentication
    • CSV
    • DB
    • FormBuilder
    • FSDB
    • IP2Country
    • Mailer
    • MobiDetect
    • Navigation
    • StaticCache
  • PHP

Classes

  • Message
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class Message

Simplifies sending emails.

Simplifies sending emails by automatically verifying email addresses and fetching HTML.

Usage

$m = new \Module\Mailer\Message();
  $m->addTo("test@test.com");
  $m->addFrom("from.me@test.com");
  $m->addSubject("This is a test, don't panic.");
  $m->fetchHTML("http://test.com/template.php");
  $m->send();

Changelog

Version 1.8

  • Added namespacing

Version 1.6

  • Fixed bug with BCC and CC
Namespace: Module\Mailer
License: http://opensource.org/licenses/MIT
Author: Jaime Rodriguez, hi.i.am.jaime@gmail.com
Version: 1.8
Date: August 13, 2014
Located at class.mailer.php
Methods summary
public
# __construct( )
public boolean
# send( )

Sends the email.

Sends the email.

Returns

boolean
Was the email successfully sent?
public
# addTo( string $email )

Adds a primary recipient.

Adds a primary recipient.

Parameters

$email
A valid email address.
public
# addCc( string $email )

Adds a Carbon Copy recipient.

Adds a Carbon Copy recipient.

Parameters

$email
A valid email address.
public
# addBcc( string $email )

Adds a Blind Carbon Copy recipient.

Adds a Blind Carbon Copy recipient.

Parameters

$email
A valid email address
public
# addFrom( string $email )

Sets a senders email address.

Sets a senders email address.

Parameters

$email
A valid email address.
public
# fetchHtml( string $url )

Gets HTML for a $url and repalces anything in the body of the email with the HTML that it fetched.

Gets HTML for a $url and repalces anything in the body of the email with the HTML that it fetched.

Parameters

$url
the url of an html file for the email body.
public
# msgText( string $msg, boolean $switch = false )

Sets the body of the email to text.

Sets the body of the email to text.

Parameters

$msg
a string for the body
$switch
an optional parameter for overloading $this->html
public
# addSubject( string $subject = '' )

Adds a subject to the email. If there is no subject the time will be used.

Adds a subject to the email. If there is no subject the time will be used.

Parameters

$subject
The subject of the email
private string[]
# rfcCheck( string $string )

Extracts the email address from a RFC 2822 compliant string

Extracts the email address from a RFC 2822 compliant string

Parameters

$string
RFC 2822 compliant string

Returns

string[]
an array of email addresses
Properties summary
private $to
#
private $cc
#
private $bcc
#
private $from
#
private $subject
#
private $body
#
private $html
#
sleepyMUSTACHE v.0.8 API documentation generated by ApiGen