PHP Class Jyxo\Mail\Sender

Based on PhpMailer class (C) Copyright 2001-2003 Brent R. Matzelle
Author: Jaroslav HanslĂ­k
Datei anzeigen Open project: jyxo/php

Public Methods

Method Description
getCharset ( ) : string Returns charset.
getEmail ( ) : Email | null Returns the email to be sent.
getEncoding ( ) : string Returns encoding.
getHostname ( ) : string Returns hostname.
getXmailer ( ) : string Returns X-Mailer header value.
send ( string $mode ) : Result Sends an email using the given mode.
setCharset ( string $charset ) : self Sets charset.
setEmail ( Email $email ) : self Sets the email to be sent.
setEncoding ( string $encoding ) : self Sets encoding.
setHostname ( string $hostname ) : self Sets hostname.
setSmtp ( string $host, integer $port = 25, string $helo = '', string $user = '', string $password = '', integer $timeout = 5 ) : self Sets SMTP parameters.
setXmailer ( string $xmailer ) : self Sets X-Mailer header value.

Private Methods

Method Description
addHeaderLine ( string $name, string $value ) Adds a header line.
attachAll ( ) : string Adds all attachments to the email.
changeCharset ( string $string ) : string Converts a string from UTF-8 into the email encoding.
clearHeaderValue ( string $string ) : string Clears headers from line endings.
create ( ) Creates an email.
createBody ( ) Creates body.
createHeader ( ) Creates header.
encodeHeader ( string $string ) : string Encodes headers.
encodeString ( string $string, string $encoding, integer $lineLength = self::LINE_LENGTH ) : string Encodes a string using the given encoding.
formatAddress ( Address $address ) : string Formats an email address.
formatAddressList ( array $addressList ) : string Formats a list of addresses.
getBoundaryEnd ( string $boundary ) : string Returns an end of an email part.
getBoundaryStart ( string $boundary, string $contentType, string $charset, string $encoding ) : string Returns a beginning of an email part.
getHeader ( array $except = [] ) : string Returns headers except given lines.
sendByMail ( ) Sends an email using the mail() function.
sendBySmtp ( ) Sends an email using a SMTP server.

Method Details

getCharset() public method

Returns charset.
public getCharset ( ) : string
return string

getEmail() public method

Returns the email to be sent.
public getEmail ( ) : Email | null
return Email | null

getEncoding() public method

Returns encoding.
public getEncoding ( ) : string
return string

getHostname() public method

Returns hostname.
public getHostname ( ) : string
return string

getXmailer() public method

Returns X-Mailer header value.
public getXmailer ( ) : string
return string

send() public method

Sends an email using the given mode.
public send ( string $mode ) : Result
$mode string Sending mode
return Jyxo\Mail\Sender\Result

setCharset() public method

Sets charset.
public setCharset ( string $charset ) : self
$charset string Final charset
return self

setEmail() public method

Sets the email to be sent.
public setEmail ( Email $email ) : self
$email Email Email instance
return self

setEncoding() public method

Sets encoding.
public setEncoding ( string $encoding ) : self
$encoding string Encoding
return self

setHostname() public method

Sets hostname.
public setHostname ( string $hostname ) : self
$hostname string Hostname
return self

setSmtp() public method

Sets SMTP parameters.
public setSmtp ( string $host, integer $port = 25, string $helo = '', string $user = '', string $password = '', integer $timeout = 5 ) : self
$host string Hostname
$port integer Port
$helo string HELO value
$user string Username
$password string Password
$timeout integer Connection timeout
return self

setXmailer() public method

Sets X-Mailer header value.
public setXmailer ( string $xmailer ) : self
$xmailer string X-Mailer header value
return self