Skip to content

Commit

Permalink
Docs about mail debugging added
Browse files Browse the repository at this point in the history
  • Loading branch information
klimov-paul committed Jun 4, 2014
1 parent df6b733 commit 38a6b4f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/guide/tutorial-mailing.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,23 @@ Then inside view file you can use following code:
```


Testing and debugging
---------------------

Developer often a to check, what actual emails are sent by application, what was their content and so on.
Such ability is granted by Yii via `yii\mail\BaseMailer::useFileTransport`. If enabled, this option enforces
saving mail message data into the local files instead of regular sending. These files will be saved under
`yii\mail\BaseMailer::fileTransportPath`, which is '@runtime/mail' by default.

> Note: you can either save messages to the file or send them to actual recipients, but can not do both simultaneously.
Mail message file can be opened by regular text file editor, so you can browse actual message headers, content and so on.
This mechanism amy prove itself, while debugging application or running unit test.

> Note: mail message file content is composed via `\yii\mail\MessageInterface::toString()`, so it depends on actual
mail extension you are using in your application.


Creating your own mail solution
-------------------------------

Expand Down

0 comments on commit 38a6b4f

Please sign in to comment.