Skip to content

Remove some small email articles #8745

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

Merged
merged 3 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions _build/redirection_map
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@
/cookbook/doctrine/reverse_engineering /doctrine/reverse_engineering
/doctrine/repository /doctrine
/doctrine/console /doctrine
/cookbook/email/cloud /email/cloud
/cookbook/email/cloud /email
/cookbook/email/dev_environment /email/dev_environment
/cookbook/email/email /email
/cookbook/email/gmail /email/gmail
/cookbook/email/gmail /email
/cookbook/email/index /email
/cookbook/email/spool /email/spool
/cookbook/email/testing /email/testing
Expand Down Expand Up @@ -361,6 +361,8 @@
/console/logging /console
/deployment/tools /deployment
/install/bundles /setup/bundles
/email/gmail /email
/email/cloud /email
/event_dispatcher/class_extension /event_dispatcher
/form /forms
/form/use_virtual_forms /form/inherit_data_option
Expand Down
52 changes: 47 additions & 5 deletions email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ environment variable in the ``.env`` file:
# use this to disable email delivery
MAILER_URL=null://localhost

# use this to send emails via Gmail (don't use this in production)
MAILER_URL=gmail://username:password@localhost

# use this to configure a traditional SMTP server
MAILER_URL=smtp://localhost:25?encryption=ssl&auth_mode=login&username=&password=

Expand Down Expand Up @@ -107,15 +104,58 @@ The ``$message`` object supports many more options, such as including attachment
adding HTML content, and much more. Refer to the `Creating Messages`_ section
of the Swift Mailer documentation for more details.

.. _email-using-gmail:

Using Gmail to Send Emails
--------------------------

During development, you might prefer to send emails using Gmail instead of
setting up a regular SMTP server. To do that, update the ``MAILER_URL`` of your
``.env`` file to this:

.. code-block:: bash

# username is your full Gmail or Google Apps email address
MAILER_URL=gmail://username:password@localhost

The ``gmail`` transport is simply a shortcut that uses the ``smtp`` transport,
``ssl`` encryption, ``login`` auth mode and ``smtp.gmail.com`` host. If your app
uses other encryption or auth mode, you must override those values
(:doc:`see mailer config reference </reference/configuration/swiftmailer>`):

.. code-block:: bash

# username is your full Gmail or Google Apps email address
MAILER_URL=gmail://username:password@localhost?encryption=tls&auth_mode=oauth

If your Gmail account uses 2-Step-Verification, you must `generate an App password`_
and use it as the value of the mailer password. You must also ensure that you
`allow less secure apps to access your Gmail account`_.

Using Cloud Services to Send Emails
-----------------------------------

Cloud mailing services are a popular option for companies that don't want to set
up and maintain their own reliable mail servers. In Symfony apps, using these
services is as simple as updating the value of ``MAILER_URL`` in the ``.env``
file. For example, for `Amazon SES`_ (Simple Email Service):

.. code-block:: bash

# The host will be different depending on your AWS zone
# The username/password credentials are obtained from the Amazon SES console
MAILER_URL=smtp://email-smtp.us-east-1.amazonaws.com:587?encryption=tls&username=YOUR_SES_USERNAME&password=YOUR_SES_PASSWORD

Use the same technique for other mail services, as most of the time there is
nothing more to it than configuring an SMTP endpoint.

Learn more
----------

.. toctree::
:maxdepth: 1

email/dev_environment
email/gmail
email/cloud
email/spool
email/testing

Expand All @@ -125,3 +165,5 @@ Learn more
.. _`Mandrill`: https://mandrill.com/
.. _`SendGrid`: https://sendgrid.com/
.. _`Amazon SES`: http://aws.amazon.com/ses/
.. _`generate an App password`: https://support.google.com/accounts/answer/185833
.. _`allow less secure apps to access your Gmail account`: https://support.google.com/accounts/answer/6010255
52 changes: 0 additions & 52 deletions email/cloud.rst

This file was deleted.

46 changes: 0 additions & 46 deletions email/gmail.rst

This file was deleted.

2 changes: 1 addition & 1 deletion reference/configuration/swiftmailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ transport
The exact transport method to use to deliver emails. Valid values are:

* smtp
* gmail (see :doc:`/email/gmail`)
* gmail (see :ref:`email-using-gmail`)
* mail (deprecated in SwiftMailer since version 5.4.5)
* sendmail
* null (same as setting `disable_delivery`_ to ``true``)
Expand Down