프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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 setSubject ( string $subject ) : |
||
$subject | string | The subject message |
리턴 |
protected wrapLayout ( string $content ) | ||
$content | string | The content to wrapp inside the layout. |
public $layout |