You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your server has Sendmail installed, update the `config/autoload/mail.local.php.dist` file by setting the `transport` key like below
31
+
If your server has Sendmail installed, update the `config/autoload/mail.local.php.dist` file by setting the `transport` key like below:
32
32
33
33
```php
34
-
<?php
35
34
return [
36
35
'dot_mail' => [
37
36
'default' => [
@@ -40,12 +39,13 @@ return [
40
39
//...
41
40
]
42
41
]
43
-
]
42
+
];
44
43
```
45
44
46
45
### Mail - ESMTP
47
46
48
-
If you want your application to send mails on e.g. registration, contact, then edit the file `config/autoload/mail.local.php`. Set the `transport`, `message_options` and `smtp_options` keys like below.
47
+
If you want your application to send mails on e.g., registration, contact, then edit the file `config/autoload/mail.local.php`.
48
+
Set the `transport`, `message_options` and `smtp_options` keys like below.
49
49
50
50
Under `message_options` key:
51
51
@@ -56,12 +56,11 @@ Under `smtp_options` key:
56
56
-`host` - the mail server's hostname or IP address
57
57
-`port` - the mail server's port
58
58
-`connection_config` - fill in the `username` and `password` keys with the login details of the email used in `from` above
59
-
- if you want to disable auto_tls set `tls` key to false
59
+
- if you want to disable `auto_tls` set `tls` key to false
60
60
61
-
> Note: all other keys can be left as is.
61
+
> All other keys can be left as is.
62
62
63
63
```php
64
-
<?php
65
64
return [
66
65
'dot_mail' => [
67
66
'default' => [
@@ -83,22 +82,25 @@ return [
83
82
//...
84
83
]
85
84
]
86
-
]
85
+
];
87
86
```
88
87
89
-
In `config/autoload/local.php` add under `contact` => `message_receivers` => `to` key *string* values with the emails that should receive contact messages
88
+
In `config/autoload/local.php` add under `contact` => `message_receivers` => `to` key *string* values with the emails that should receive contact messages.
90
89
91
-
> Note: **Please add at least 1 email address in order for contact message to reach someone**
90
+
> **Please add at least one email address in order for a contact message to reach someone**
92
91
93
-
Also feel free to add as many cc as you want under `contact` => `message_receivers` => `cc` key
92
+
Also feel free to add as many cc as you want under `contact` => `message_receivers` => `cc` key.
94
93
95
94
### Sending an e-mail
96
95
97
-
Below is an example of how to use the email in the most basic way. You can add your own code to it e.g. to get the user data from a User object or from a config file, to use a template for the body.
96
+
Below is an example of how to use the email in the most basic way.
97
+
You can add your own code to it, e.g., to get the user data from a User object or from a config file, to use a template for the body.
98
98
99
-
Note that `addTo` is only one of the methods available for the `Message` class returned by `getMessage()`. Other useful methods that were not included in the example are `addCc()`, `addBcc()`, `addReplyTo()`.
99
+
Note that `addTo` is only one of the methods available for the `Message` class returned by `getMessage()`.
100
+
Other useful methods that were not included in the example are `addCc()`, `addBcc()`, `addReplyTo()`.
100
101
101
-
The returned type is boolean, but if the `isValid()` method is removed, the returned type becomes `MailResult` which allows the use of `getMessage()` for a more detailed error message. See the `Testing if an e-mail message is valid` section below.
102
+
The returned type is boolean, but if the `isValid()` method is removed, the returned type becomes `MailResult` which allows the use of `getMessage()` for a more detailed error message.
103
+
See the `Testing if an e-mail message is valid` section below.
102
104
103
105
```php
104
106
public function sendBasicMail()
@@ -111,7 +113,8 @@ public function sendBasicMail()
111
113
}
112
114
```
113
115
114
-
It's optional, but recommended to call the above function in a `try-catch` block to display helpful error messages. The next example calls the `sendBasicMail` function from within `UserController`, but you can implement it in other controllers, just make sure that the controller's construct also includes the `FlashMessenger` parameter `$messenger`.
116
+
It's optional but recommended to call the above function in a `try-catch` block to display helpful error messages.
117
+
The next example calls the `sendBasicMail` function from within `UserController`, but you can implement it in other controllers, just make sure that the controller's construct also includes the `FlashMessenger` parameter `$messenger`.
115
118
116
119
```php
117
120
try {
@@ -126,7 +129,7 @@ try {
126
129
127
130
### Testing if an e-mail message is valid
128
131
129
-
After sending an e-mail you can check if the message was valid or not.
132
+
After sending an e-mail, you can check if the message was valid or not.
130
133
The `$this->mailService->send()->isValid()` method call will return a boolean value.
131
134
If the returned result is `true`, the e-mail was valid, otherwise the e-mail was invalid.
132
135
In case your e-mail was invalid, you can check for any errors using `$this->mailService->send()->getMessage()`.
@@ -146,19 +149,18 @@ if (! $result->isValid()) {
146
149
147
150
### Logging outgoing emails
148
151
149
-
Optionally, you can keep a log of each successfully sent email. This might be useful when you need to know if/when a specific email has been sent out to a recipient.
152
+
Optionally, you can keep a log of each successfully sent email.
153
+
This might be useful when you need to know if/when a specific email has been sent out to a recipient.
| 5.x |:white_check_mark:||
7
+
| 5.x |:white_check_mark:||
9
8
| 4.x |:white_check_mark:||
10
9
| <= 3.x |:x:||
11
10
12
-
13
11
## Reporting Potential Security Issues
14
12
15
-
If you have encountered a potential security vulnerability in this project,
16
-
please report it to us at <security@dotkernel.com>. We will work with you to
17
-
verify the vulnerability and patch it.
13
+
If you have encountered a potential security vulnerability in this project, please report it to us at <security@dotkernel.com>.
14
+
We will work with you to verify the vulnerability and patch it.
18
15
19
16
When reporting issues, please provide the following information:
20
17
21
18
- Component(s) affected
22
19
- A description indicating how to reproduce the issue
23
20
- A summary of the security vulnerability and impact
24
21
25
-
We request that you contact us via the email address above and give the
26
-
project contributors a chance to resolve the vulnerability and issue a new
27
-
release prior to any public exposure; this helps protect the project's
28
-
users, and provides them with a chance to upgrade and/or update in order to
29
-
protect their applications.
30
-
22
+
We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure;
23
+
this helps protect the project's users and provides them with a chance to upgrade and/or update to protect their applications.
31
24
32
25
## Policy
33
26
34
27
If we verify a reported security vulnerability, our policy is:
35
28
36
-
- We will patch the current release branch, as well as the immediate prior minor
37
-
release branch.
38
-
39
-
- After patching the release branches, we will immediately issue new security
40
-
fix releases for each patched release branch.
29
+
- We will patch the current release branch, as well as the immediate prior minor release branch.
30
+
- After patching the release branches, we will immediately issue new security fix releases for each patched release branch.
Copy file name to clipboardExpand all lines: docs/book/v4/transports.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,20 +9,23 @@
9
9
10
10
> Feel free to use any custom transport you desire, provided it implements the mentioned `TransportInterface`.
11
11
12
-
`Sendmail` is a wrapper over PHP's `mail()` function, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with**`addBcc()`.
12
+
`Sendmail` is a wrapper over PHP's `mail()` function, and as such has a different behavior on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with**`addBcc()`.
13
13
14
14
- Note: emails sent using the sendmail transport will be more often delivered to SPAM.
15
15
16
-
`Smtp` connects to the configured SMTP host in order to handle sending emails. Saving a copy of an outgoing mail into a folder is possible for this transport only, and is done by uncommenting `save_sent_message_folder` in the config file `mail.local.php` under `dot_mail.default`.
16
+
`Smtp` connects to the configured SMTP host to handle sending emails.
17
+
Saving a copy of outgoing mail into a folder is possible for this transport only, and is done by uncommenting `save_sent_message_folder` in the config file `mail.local.php` under `dot_mail.default`.
17
18
18
-
- Common folder names are `INBOX`, `INBOX.Archive`, `INBOX.Drafts`, `INBOX.Sent`, `INBOX.Spam`, `INBOX.Trash`. If you have `MailService` available in your class, you can call `$this->mailService->getFolderGlobalNames()` to list the folder global names for the email you are using.
19
+
- Common folder names are `INBOX`, `INBOX.Archive`, `INBOX.Drafts`, `INBOX.Sent`, `INBOX.Spam`, `INBOX.Trash`.
20
+
If you have `MailService` available in your class, you can call `$this->mailService->getFolderGlobalNames()` to list the folder global names for the email you are using.
19
21
- Multiple folders can be added to the `save_sent_message_folder` key to save a copy of the outgoing email in each folder.
20
22
21
-
`File` writes each message individually in a file named after the configured format, placed in the configured directory. From here the files may be used for sending via another transport mechanism, or simply as logs.
23
+
`File` writes each message individually in a file named after the configured format, placed in the configured directory.
24
+
From here the files may be used for sending via another transport mechanism, or simply as logs.
22
25
23
26
`InMemory` saves the message in memory, allowing access to the last "sent" message via the `getLastMessage()` function.
24
27
25
-
- As the email is not sent, this transport can be helpful in development, with the access to the message being potentially useful in tests as well
28
+
- As the email is not sent, this transport can be helpful in development, with the access to the message being potentially useful in tests as well.
Copy file name to clipboardExpand all lines: docs/book/v4/usage.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,13 @@
2
2
3
3
## Sending an e-mail
4
4
5
-
Below is an example of how to use the email in the most basic way. You can add your own code to it e.g. to get the user data from a User object or from a config file, to use a template for the body.
5
+
Below is an example of how to use the email in the most basic way. You can add your own code to it, e.g., to get the user data from a User object or from a config file, to use a template for the body.
6
6
7
-
Note that `addTo` is only one of the methods available for the `Message` class returned by `getMessage()`. Other useful methods that were not included in the example are `addCc()`, `addBcc()`, `addReplyTo()`.
7
+
Note that `addTo` is only one of the methods available for the `Message` class returned by `getMessage()`.
8
+
Other useful methods that were not included in the example are `addCc()`, `addBcc()`, `addReplyTo()`.
8
9
9
-
The returned type is boolean, but if the `isValid()` method is removed, the returned type becomes `MailResult` which allows the use of `getMessage()` for a more detailed error message. See the `Testing if an e-mail message is valid` section below.
10
+
The returned type is boolean, but if the `isValid()` method is removed, the returned type becomes `MailResult` which allows the use of `getMessage()` for a more detailed error message.
11
+
See the `Testing if an e-mail message is valid` section below.
10
12
11
13
```php
12
14
public function sendBasicMail()
@@ -19,7 +21,8 @@ public function sendBasicMail()
19
21
}
20
22
```
21
23
22
-
It's optional, but recommended to call the above function in a `try-catch` block to display helpful error messages. The next example calls the `sendBasicMail` function from within `UserController`, but you can implement it in other controllers, just make sure that the controller's construct also includes the `FlashMessenger` parameter `$messenger`.
24
+
It's optional but recommended to call the above function in a `try-catch` block to display helpful error messages.
25
+
The next example calls the `sendBasicMail` function from within `UserController`, but you can implement it in other controllers, just make sure that the controller's construct also includes the `FlashMessenger` parameter `$messenger`.
23
26
24
27
```php
25
28
try {
@@ -34,7 +37,7 @@ try {
34
37
35
38
## Testing if an e-mail message is valid
36
39
37
-
After sending an e-mail you can check if the message was valid or not.
40
+
After sending an e-mail, you can check if the message was valid or not.
38
41
The `$this->mailService->send()->isValid()` method call will return a boolean value.
39
42
If the returned result is `true`, the e-mail was valid, otherwise the e-mail was invalid.
40
43
In case your e-mail was invalid, you can check for any errors using `$this->mailService->send()->getMessage()`.
0 commit comments