Class cMailer
Mailer class which should be used for all mail sending purposes.
- Swift_Mailer
- cMailer
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Rusmir Jusufovic, Simon Sprankel
Located at classes/class.mailer.php
public
|
|
public static
|
#
constructTransport( string $mailHost, string $mailPort, string $mailEncryption = NULL, string $mailUser = NULL, string $mailPass = NULL )
Tries to establish an SMTP connection with the given settings. If this is possible, a Swift_SmtpTransport object is returned. Otherwise a simple Swift_MailTransport object is returned. |
public
|
#
setCharset( string $charset )
Sets the charset of the messages which are sent with this mailer object. If you want to use UTF-8, you do not need to call this method. |
public
integer
|
#
sendMail( string|array $from, string|array $to, string $subject, string $body = '', string|array $cc = NULL, string|array $bcc = NULL, string|array $replyTo = NULL, boolean $resend = false, string $contentType = 'text/plain' )
Wrapper function for sending a mail. All parameters which accept mail addresses also accept an array where the key is the email address and the value is the name. |
public
integer
|
#
send(
Sends the given Swift_Mime_Message and logs it if $resend is false. |
public
|
|
private
string
|
#
encodeField( string|array $value, string $charset )
Encodes the given value / the given array values with htmlentities. |
private
string
|
#
decodeField( string|array $value, string $charset )
Decodes the given value / the given array values with html_entity_decode. |
private
string
|
#
_logMail(
Log the information about sending the email. |
createMessage(),
getTransport(),
newInstance(),
registerPlugin()
|
private
string
|
$_mailHost
The mail host name |
#
'localhost'
|
private
string
|
$_mailUser
The username for authentication at the host |
#
''
|
private
string
|
$_mailPass
The password for authentication at the host |
#
''
|
private
string
|
$_mailEncryption
The encryption method (ssl/tls). |
#
NULL
|
private
integer
|
$_mailPort
The port to use at the host |
#
25
|
private
string
|
$_mailSender
The mail address of the sender |
#
'noreply@contenido.org'
|
private
string
|
$_mailSenderName
The name of the sender |
#
'CONTENIDO Backend'
|