Skip to content

Commit 889e153

Browse files
committed
Remove some small email articles
1 parent 8e9dc96 commit 889e153

File tree

4 files changed

+49
-105
lines changed

4 files changed

+49
-105
lines changed

_build/redirection_map

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
/cookbook/doctrine/registration_form /doctrine/registration_form
151151
/cookbook/doctrine/resolve_target_entity /doctrine/resolve_target_entity
152152
/cookbook/doctrine/reverse_engineering /doctrine/reverse_engineering
153-
/cookbook/email/cloud /email/cloud
153+
/cookbook/email/cloud /email
154154
/cookbook/email/dev_environment /email/dev_environment
155155
/cookbook/email/email /email
156-
/cookbook/email/gmail /email/gmail
156+
/cookbook/email/gmail /email
157157
/cookbook/email/index /email
158158
/cookbook/email/spool /email/spool
159159
/cookbook/email/testing /email/testing
@@ -348,6 +348,8 @@
348348
/components/yaml/index /components/yaml
349349
/deployment/tools /deployment
350350
/install/bundles /setup/bundles
351+
/email/gmail /email
352+
/email/cloud /email
351353
/event_dispatcher/class_extension /event_dispatcher
352354
/form /forms
353355
/form/use_virtual_forms /form/inherit_data_option

email.rst

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ environment variable in the ``.env`` file:
3737
# use this to disable email delivery
3838
MAILER_URL=null://localhost
3939
40-
# use this to send emails via Gmail (don't use this in production)
41-
MAILER_URL=gmail://username:password@localhost
42-
4340
# use this to configure a traditional SMTP server
4441
MAILER_URL=smtp://localhost:25?encryption=ssl&auth_mode=login&username=&password=
4542
@@ -107,15 +104,56 @@ The ``$message`` object supports many more options, such as including attachment
107104
adding HTML content, and much more. Refer to the `Creating Messages`_ section
108105
of the Swift Mailer documentation for more details.
109106

107+
Using Gmail to Send Emails
108+
--------------------------
109+
110+
During development, you might prefer to send emails using Gmail instead of
111+
setting up a regular SMTP server. To do that, update the ``MAILER_URL`` of your
112+
``.env`` file to this:
113+
114+
.. code-block:: bash
115+
116+
# username is your full Gmail or Google Apps email address
117+
MAILER_URL=gmail://username:password@localhost
118+
119+
The ``gmail`` transport is simply a shortcut that uses the ``smtp`` transport,
120+
``ssl`` encryption, ``login`` auth mode and ``smtp.gmail.com`` host. If your app
121+
uses other encryption or auth mode, you must override those values
122+
(:doc:`see mailer config reference </reference/configuration/swiftmailer>`):
123+
124+
.. code-block:: bash
125+
126+
# username is your full Gmail or Google Apps email address
127+
MAILER_URL=gmail://username:password@localhost?encryption=tls&auth_mode=oauth
128+
129+
If your Gmail account uses 2-Step-Verification, you must `generate an App password`_
130+
and use it as the value of the mailer password. You must also ensure that you
131+
`allow less secure apps to access your Gmail account`_.
132+
133+
Using Cloud Services to Send Emails
134+
-----------------------------------
135+
136+
Cloud mailing services are a popular option for companies that don't want to set
137+
up and maintain their own reliable mail servers. In Symfony apps, using these
138+
services is as simple as updating the value of ``MAILER_URL`` in the ``.env``
139+
file. For example, for `Amazon SES`_ (Simple Email Service):
140+
141+
.. code-block:: bash
142+
143+
# The host will be different depending on your AWS zone
144+
# The username/password credentials are obtained from the Amazon SES console
145+
MAILER_URL=smtp://email-smtp.us-east-1.amazonaws.com:587?encryption=tls&username=YOUR_SES_USERNAME&password=YOUR_SES_PASSWORD
146+
147+
Use the same technique for other mail services, as most of the time there is
148+
nothing more to it than configuring an SMTP endpoint.
149+
110150
Learn more
111151
----------
112152

113153
.. toctree::
114154
:maxdepth: 1
115155

116156
email/dev_environment
117-
email/gmail
118-
email/cloud
119157
email/spool
120158
email/testing
121159

@@ -125,3 +163,5 @@ Learn more
125163
.. _`Mandrill`: https://mandrill.com/
126164
.. _`SendGrid`: https://sendgrid.com/
127165
.. _`Amazon SES`: http://aws.amazon.com/ses/
166+
.. _`generate an App password`: https://support.google.com/accounts/answer/185833
167+
.. _`allow less secure apps to access your Gmail account`: https://support.google.com/accounts/answer/6010255

email/cloud.rst

Lines changed: 0 additions & 52 deletions
This file was deleted.

email/gmail.rst

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)