Mail
in package
implements
MailInterface
Mail base class
Table of Contents
Interfaces
- MailInterface
- Mail interface
Constants
- HTML_CONTENT_TYPE = 'text/html'
- PLAIN_CONTENT_TYPE = 'text/plain'
Properties
- $contentType : string
- Email content type
- $errors : mixed
- Errors
- $message : Email
- Message
- $mailer : MailerInterface
- Mailer
Methods
- __construct() : mixed
- Constructor
- attach() : self
- Attach file
- bcc() : self
- Set bcc
- build() : self
- Build email
- cc() : self
- Set cc
- contentType() : self
- Set email content type
- create() : self
- Create mail
- from() : self
- Set from
- getBody() : mixed
- Return message body
- getError() : string|null
- Get error message
- getErros() : array<string|int, mixed>
- Get errors
- getFrom() : mixed
- Get from address email, name
- getMessage() : Email
- Get message instance
- hasError() : bool
- Has errors
- message() : self
- Set email body
- priority() : self
- Set priority
- replyTo() : self
- Set reply to
- send() : bool
- Send email
- subject() : self
- Set email subject
- to() : self
- Set to
Constants
HTML_CONTENT_TYPE
public
mixed
HTML_CONTENT_TYPE
= 'text/html'
PLAIN_CONTENT_TYPE
public
mixed
PLAIN_CONTENT_TYPE
= 'text/plain'
Properties
$contentType
Email content type
protected
string
$contentType
= Self::PLAIN_CONTENT_TYPE
$errors
Errors
protected
mixed
$errors
= []
@var array
$message
Message
protected
Email
$message
$mailer
Mailer
private
MailerInterface
$mailer
Methods
__construct()
Constructor
public
__construct(MailerInterface $mailer) : mixed
Parameters
- $mailer : MailerInterface
attach()
Attach file
public
attach(string $path[, string $name = null ][, string $contentType = null ]) : self
Parameters
- $path : string
- $name : string = null
- $contentType : string = null
Return values
selfbcc()
Set bcc
public
bcc(string $email[, string|null $name = null ]) : self
Parameters
- $email : string
- $name : string|null = null
Return values
selfbuild()
Build email
public
build() : self
Return values
selfcc()
Set cc
public
cc(string $email[, string|null $name = null ]) : self
Parameters
- $email : string
- $name : string|null = null
Return values
selfcontentType()
Set email content type
public
contentType([string $type = Self::PLAIN_CONTENT_TYPE ]) : self
Parameters
- $type : string = Self::PLAIN_CONTENT_TYPE
Return values
selfcreate()
Create mail
public
static create(MailerInterface $mailer) : self
Parameters
- $mailer : MailerInterface
Return values
selffrom()
Set from
public
from(string $email[, string|null $name = null ]) : self
Parameters
- $email : string
- $name : string|null = null
Return values
selfgetBody()
Return message body
public
getBody() : mixed
getError()
Get error message
public
getError() : string|null
Return values
string|nullgetErros()
Get errors
public
getErros() : array<string|int, mixed>
Return values
array<string|int, mixed>getFrom()
Get from address email, name
public
getFrom() : mixed
getMessage()
Get message instance
public
getMessage() : Email
Return values
EmailhasError()
Has errors
public
hasError() : bool
Return values
boolmessage()
Set email body
public
message(string $message[, string|null $contentType = null ]) : self
Parameters
- $message : string
- $contentType : string|null = null
Return values
selfpriority()
Set priority
public
priority([int $priority = 3 ]) : self
Parameters
- $priority : int = 3
Return values
selfreplyTo()
Set reply to
public
replyTo(string $email[, string|null $name = null ]) : self
Parameters
- $email : string
- $name : string|null = null
Return values
selfsend()
Send email
public
send() : bool
Return values
boolsubject()
Set email subject
public
subject(string $subject) : self
Parameters
- $subject : string
Return values
selfto()
Set to
public
to(string $email[, string|null $name = null ]) : self
Parameters
- $email : string
- $name : string|null = null