PHP Class Jyxo\Mail\Sender\Smtp

Works in combination with \Jyxo\Mail\Sender.
Author: Jaroslav HanslĂ­k
Datei anzeigen Open project: jyxo/php

Public Methods

Method Description
__construct ( string $host = 'localhost', integer $port = 25, string $helo = 'localhost', integer $timeout = 5 ) Creates an instance.
__destruct ( ) Destroys an instance and disconnects from the server.
auth ( string $user, string $password ) : self Connects to the server using a username and password.
connect ( ) : self Connects to the SMTP server.
data ( string $header, string $body ) : self Sends email headers and body.
disconnect ( ) : self Disconnects from server.
from ( string $from ) : self Sets the sender.
recipient ( string $recipient ) : self Adds a recipient.
reset ( ) : self Resets previous commands.

Private Methods

Method Description
commandData ( ) Sends the DATA command.
commandHelo ( ) Sends the EHLO/HELO command.
commandMailFrom ( string $from ) Sends the MAIL FROM command.
commandRcptTo ( string $recipient ) Sends the RCPT TO command.
commandRset ( ) Sends the RSET command.
readData ( ) : string Reads data from the server.
writeData ( string $data ) Sends data to the server.

Method Details

__construct() public method

Creates an instance.
public __construct ( string $host = 'localhost', integer $port = 25, string $helo = 'localhost', integer $timeout = 5 )
$host string Server hostname
$port integer Server port
$helo string HELO value
$timeout integer Connection timeout

__destruct() public method

Destroys an instance and disconnects from the server.
public __destruct ( )

auth() public method

Connects to the server using a username and password.
public auth ( string $user, string $password ) : self
$user string Username
$password string Password
return self

connect() public method

Connects to the SMTP server.
public connect ( ) : self
return self

data() public method

Sends email headers and body.
public data ( string $header, string $body ) : self
$header string Headers
$body string Body
return self

disconnect() public method

Disconnects from server.
public disconnect ( ) : self
return self

from() public method

Sets the sender.
public from ( string $from ) : self
$from string Sender
return self

recipient() public method

Adds a recipient.
public recipient ( string $recipient ) : self
$recipient string Recipient
return self

reset() public method

Resets previous commands.
public reset ( ) : self
return self