Skip to content

[Mailer] Add feature mailer:send-email #14725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@ party provider:

Note that the protocol is *always* HTTPs and cannot be changed.

Checking your configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Checking your configuration
Checking your Configuration

~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you have any doubt on your configuration. Or if want to make sure your mail supplier is still working.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you have any doubt on your configuration. Or if want to make sure your mail supplier is still working.
If you have any doubt on your configuration or if want to make sure your mail supplier is working properly,

You can do this with the ``mailer:send-email`` command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can do this with the ``mailer:send-email`` command:
you can do this by using the ``mailer:send-email`` command:


.. code-block:: terminal

$ php bin/console mailer:send-email [email protected] [email protected] --subject=Test --body=body

# No subject/body to send simple test mail
$ php bin/console mailer:send-email [email protected] [email protected]

The command can also send body from file using ``--body-source`` option:

.. code-block:: terminal

$ php bin/console mailer:send-email [email protected] [email protected] --body-source=file --body=/path/to/file
Comment on lines +199 to +210
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: terminal
$ php bin/console mailer:send-email [email protected] [email protected] --subject=Test --body=body
# No subject/body to send simple test mail
$ php bin/console mailer:send-email [email protected] [email protected]
The command can also send body from file using ``--body-source`` option:
.. code-block:: terminal
$ php bin/console mailer:send-email [email protected] [email protected] --body-source=file --body=/path/to/file
.. code-block:: terminal
// no subject or body needed to send a simple test mail
$ php bin/console mailer:send-email [email protected] [email protected]
// use a custom body and/or subject
$ php bin/console mailer:send-email [email protected] [email protected] --subject=Test --body=body
// use a file for the body
$ php bin/console mailer:send-email [email protected] [email protected] --body-source=file --body=/path/to/file


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. versionadded:: 5.3
The ``mailer:send-email`` command was introduced in Symfony 5.3.


High Availability
~~~~~~~~~~~~~~~~~

Expand Down