Skip to content

Commit 9ec841b

Browse files
committed
minor #8745 Remove some small email articles (javiereguiluz, weaverryan)
This PR was merged into the 4.0 branch. Discussion ---------- Remove some small email articles If you agree with #8668 idea ... this is the implementation to merge. Thanks! Commits ------- 9102475 Merge branch '4.0' into remove_email_articles 90ad1af Fixed the Gmail reference 889e153 Remove some small email articles
2 parents 444a49a + 9102475 commit 9ec841b

File tree

5 files changed

+52
-106
lines changed

5 files changed

+52
-106
lines changed

_build/redirection_map

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@
153153
/cookbook/doctrine/reverse_engineering /doctrine/reverse_engineering
154154
/doctrine/repository /doctrine
155155
/doctrine/console /doctrine
156-
/cookbook/email/cloud /email/cloud
156+
/cookbook/email/cloud /email
157157
/cookbook/email/dev_environment /email/dev_environment
158158
/cookbook/email/email /email
159-
/cookbook/email/gmail /email/gmail
159+
/cookbook/email/gmail /email
160160
/cookbook/email/index /email
161161
/cookbook/email/spool /email/spool
162162
/cookbook/email/testing /email/testing
@@ -361,6 +361,8 @@
361361
/console/logging /console
362362
/deployment/tools /deployment
363363
/install/bundles /setup/bundles
364+
/email/gmail /email
365+
/email/cloud /email
364366
/event_dispatcher/class_extension /event_dispatcher
365367
/form /forms
366368
/form/use_virtual_forms /form/inherit_data_option

email.rst

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

113155
.. toctree::
114156
:maxdepth: 1
115157

116158
email/dev_environment
117-
email/gmail
118-
email/cloud
119159
email/spool
120160
email/testing
121161

@@ -125,3 +165,5 @@ Learn more
125165
.. _`Mandrill`: https://mandrill.com/
126166
.. _`SendGrid`: https://sendgrid.com/
127167
.. _`Amazon SES`: http://aws.amazon.com/ses/
168+
.. _`generate an App password`: https://support.google.com/accounts/answer/185833
169+
.. _`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.

reference/configuration/swiftmailer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ transport
5858
The exact transport method to use to deliver emails. Valid values are:
5959

6060
* smtp
61-
* gmail (see :doc:`/email/gmail`)
61+
* gmail (see :ref:`email-using-gmail`)
6262
* mail (deprecated in SwiftMailer since version 5.4.5)
6363
* sendmail
6464
* null (same as setting `disable_delivery`_ to ``true``)

0 commit comments

Comments
 (0)