Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Mail

This class use PHPMailer library to send mails from Hawk applications

Hawk\Mail uses Hawk\Utils
Namespace: Hawk
Package: Network
Located at Mail.php

Methods summary

public
# __construct( array $param = array() )

Make a new mail

Make a new mail

Parameters

$param
The parameters to pass to PHPMailer
public static
# getInstance( array $param )

Static method to make a new mailer

Static method to make a new mailer

Parameters

$param
The parameters to pass to PHPMailer
public Hawk\Mail
# from( string $email, string $name = null )

Set 'from'

Set 'from'

Parameters

$email
The sender email address to set
$name
The sender name to set

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# fromName( string $name )

Set 'from-name'

Set 'from-name'

Parameters

$name
The sender name to set

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# to( string $email, string $name = '' )

Add a recipient

Add a recipient

Parameters

$email
The recipient email address
$name
The recipient name

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# replyTo( string $email, string $name = '' )

Set 'Reply-To'

Set 'Reply-To'

Parameters

$email
The email address to reply to
$name
The name of the person to reply to

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# cc( string $email, string $name = '' )

Add a recipient in copy

Add a recipient in copy

Parameters

$email
The email address to add in copy
$name
The recipient's name to add in copy

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# bcc( string $email, string $name )

Add a recipient in hidden copy

Add a recipient in hidden copy

Parameters

$email
The recipient's email address to add in hidden copy
$name
The recipient's name to add in hidden copy

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# attach( string $path, string $name = '', string $encoding = 'base64', string $type = '', string $disposition = 'attachment' )

Attach a file

Attach a file

Parameters

$path
The file path to attach
$name
The attachment name
$encoding
The encoding system to add the attachment
$type
The file MIME type
$disposition
Disposition to use

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# subject( string $subject )

Set email subject

Set email subject

Parameters

$subject
The email subject

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# html( string $html )

Set HTML content

Set HTML content

Parameters

$html
The html content to set

Returns

Hawk\Mail
The instance itself, to permit chained actions
public Hawk\Mail
# text( string $text )

Set text content

Set text content

Parameters

$text
The text to set

Returns

Hawk\Mail
The instance itself, to permit chained actions
public
# send( )

Send the mail

Send the mail

Throws

Hawk\MailException

Methods used from Hawk\Utils

debug(), getSerializedVersion(), map()

Constants summary

string DEFAULT_MAILER

Default mailing engine

Default mailing engine

# 'mail'
Hawk - PHP documentation API documentation generated by ApiGen