Skip to content

Commit 5fa1863

Browse files
committed
readme: updated
1 parent 34639bf commit 5fa1863

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

readme.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Images can also be extremely easily inserted into the HTML body of an email. Jus
7474
// automatically adds /path/to/images/background.gif to the email
7575
$mail->setHtmlBody(
7676
'<b>Hello</b> <img src="background.gif">',
77-
'/path/to/images'
77+
'/path/to/images',
7878
);
7979
```
8080

@@ -118,14 +118,14 @@ $mail = new Nette\Mail\Message;
118118
$mail->setFrom('John <john@example.com>')
119119
->addTo('[email protected]')
120120
->setHtmlBody(
121-
$latte->renderToString('email.latte', $params),
122-
'/path/to/images'
121+
$latte->renderToString('/path/to/email.latte', $params),
122+
'/path/to/images',
123123
);
124124
```
125125

126126
File `email.latte`:
127127

128-
```html
128+
```latte
129129
<html>
130130
<head>
131131
<meta charset="utf-8">
@@ -174,22 +174,22 @@ SmtpMailer
174174
To send mail via the SMTP server, use `SmtpMailer`.
175175

176176
```php
177-
$mailer = new Nette\Mail\SmtpMailer([
178-
'host' => 'smtp.gmail.com',
179-
'username' => '[email protected]',
180-
'password' => '*****',
181-
'secure' => 'ssl',
182-
]);
177+
$mailer = new Nette\Mail\SmtpMailer(
178+
host: 'smtp.gmail.com',
179+
username: '[email protected]',
180+
password: '*****',
181+
encryption: Nette\Mail\SmtpMailer::EncryptionSSL,
182+
);
183183
$mailer->send($mail);
184184
```
185185

186-
If you do not specify `host`, the value from php.ini will be used. The following additional keys can be used in the options:
186+
The following additional parameters can be passed to the constructor:
187187

188188
* `port` - if not set, the default 25 or 465 for `ssl` will be used
189-
* `context` - allows you to set [SSL context options](https://www.php.net/manual/en/context.ssl.php) for connection
190189
* `timeout` - timeout for SMTP connection
191190
* `persistent` - use persistent connection
192191
* `clientHost` - client designation
192+
* `streamOptions` - allows you to set [SSL context options](https://www.php.net/manual/en/context.ssl.php) for connection
193193

194194

195195
FallbackMailer
@@ -201,12 +201,12 @@ It does not send email but sends them through a set of mailers. If one mailer fa
201201
$mailer = new Nette\Mail\FallbackMailer([
202202
$smtpMailer,
203203
$backupSmtpMailer,
204-
$sendmailMailer
204+
$sendmailMailer,
205205
]);
206206
$mailer->send($mail);
207207
```
208208

209-
Other parameters in the constructor include the number of repeat and waiting time in miliseconds.
209+
Other parameters in the constructor include the number of repeat and waiting time in milliseconds.
210210

211211

212212
DKIM
@@ -216,14 +216,14 @@ DKIM (DomainKeys Identified Mail) is a trustworthy email technology that also he
216216
The recipient's server compares this signature with the public key stored in the domain's DNS records. By matching the signature, it is shown that the email actually originated from the sender's domain and that the message was not modified during the transmission of the message.
217217

218218
```php
219-
$options = [
220-
'domain' => 'nette.org',
221-
'selector' => 'dkim',
222-
'privateKey' => file_get_contents('../dkim/dkim.key'),
223-
'passPhrase' => '****',
224-
];
219+
$signer = new Nette\Mail\DkimSigner(
220+
domain: 'nette.org',
221+
selector: 'dkim',
222+
privateKey: file_get_contents('../dkim/dkim.key'),
223+
passPhrase: '****',
224+
);
225225

226226
$mailer = new Nette\Mail\SendmailMailer; // or SmtpMailer
227-
$mailer->setSigner(new Nette\Mail\DkimSigner($options));
227+
$mailer->setSigner($signer);
228228
$mailer->send($mail);
229229
```

0 commit comments

Comments
 (0)