Свойство | Тип | Описание | |
---|---|---|---|
$altBody | alternate text message if email client doesn't support HTML | ||
$debug | enable debug output mode 'Data and commands' | ||
$from | sender email address | ||
$fromName | sender name | ||
$host | email server host address | ||
$isSMTP | disable if you want to use old PHP sendmail | ||
$layout | Define a layout template file which is going to be wrapped around the setBody()
content. The file alias will be resolved so an example layout could look as followed:
php
$layout = '@app/views/maillayout.php';
In your config or any mailer object. As in layouts the content of the mail specific html can be access
in the $content variable. The example content of maillayout.php from above could look like this:
php
My Company |
||
$password | email server password | ||
$port | email server port | ||
$smtpSecure | Posible values are tls or ssl | ||
$username | email server username |
Метод | Описание | |
---|---|---|
address ( string $email, string $name = null ) : |
Add a single address with optional name | |
addresses ( array $emails ) : |
Correct spelled alias method for adresses. | |
adresses ( array $emails ) : |
Add multiple addresses into the mailer object. | |
bccAddress ( string $email, string $name = null ) : |
Add a single BCC address with optional name | |
bccAddresses ( array $emails ) : |
Add multiple BCC addresses into the mailer object. | |
ccAddress ( string $email, string $name = null ) : |
Add a single CC address with optional name | |
ccAddresses ( array $emails ) : |
Add multiple CC addresses into the mailer object. | |
cleanup ( ) : void | Reset the mailer object to null | |
compose ( string $subject, string $body ) : |
Compose a new mail message, this will first flush existing mailer objects | |
getError ( ) : string | Get the mailer error info if any. | |
getMailer ( ) : PHPMailer | Getter for the mailer object | |
send ( ) : boolean | Trigger the send event of the mailer | |
setBody ( string $body ) : |
Set the HTML body for the mailer message, if a layout is defined the layout will automatically wrapped about the html body. | |
setSubject ( string $subject ) : |
Set the mail message subject of the mailer instance | |
smtpTest ( $verbose ) |
Метод | Описание | |
---|---|---|
wrapLayout ( string $content ) | Wrap the layout from the $layout propertie and store the passed content as $content variable in the view. |
public bccAddress ( string $email, string $name = null ) : |
||
string | The email address e.g. [email protected] | |
$name | string | The name for the address e.g. John Doe |
Результат |
public bccAddresses ( array $emails ) : |
||
$emails | array | An array with email addresses or name => email paring to use names. |
Результат |
public ccAddresses ( array $emails ) : |
||
$emails | array | An array with email addresses or name => email paring to use names. |
Результат |
public getMailer ( ) : PHPMailer | ||
Результат | PHPMailer |
public setSubject ( string $subject ) : |
||
$subject | string | The subject message |
Результат |
protected wrapLayout ( string $content ) | ||
$content | string | The content to wrapp inside the layout. |
public $altBody |
public $layout |