@@ -85,26 +85,33 @@ DSN::
85
85
$transport = Transport::fromDsn($dsn);
86
86
87
87
Where ``$dsn `` depends on the provider you want to use. For plain SMTP, use
88
- ``smtp://user:pass@example.com `` or ``smtp://sendmail `` to use the ``sendmail ``
89
- binary. For third-party providers, refers to the following table:
90
-
91
- ==================== ================================== ================================== ================================
92
- Provider SMTP HTTP API
93
- ==================== ================================== ================================== ================================
94
- Amazon SES smtp://ACCESS_KEY:SECRET_KEY@ses http://ACCESS_KEY:SECRET_KEY@ses api://ACCESS_KEY:SECRET_KEY@ses
95
- Google Gmail smtp://USERNAME:PASSWORD@gmail n/a n/a
96
- Mailchimp Mandrill smtp://USERNAME:PASSWORD@mandrill http://KEY@mandrill api://KEY@mandrill
97
- Mailgun smtp://USERNAME:PASSWORD@mailgun http://KEY:DOMAIN@mailgun api://KEY:DOMAIN@mailgun
98
- Postmark smtp://ID:ID@postmark n/a api://KEY@postmark
99
- Sendgrid smtp://apikey:KEY@sendgrid n/a api://KEY@sendgrid
100
- ==================== ================================== ================================== ================================
88
+ ``smtp://user:pass@example.com `` or ``sendmail+smtp://default `` to use the
89
+ ``sendmail `` binary. To disable the transport, use ``null://null ``.
90
+
91
+ For third-party providers, refers to the following table:
92
+
93
+ ==================== ========================================== ========================================== ========================================
94
+ Provider SMTP HTTP API
95
+ ==================== ========================================== ========================================== ========================================
96
+ Amazon SES ses+smtp://ACCESS_KEY:SECRET_KEY@default ses+http://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default
97
+ Google Gmail gmail+smtp://USERNAME:PASSWORD@default n/a n/a
98
+ Mailchimp Mandrill mandrill+smtp://USERNAME:PASSWORD@default mandrill+http://KEY@default mandrill+api://KEY@default
99
+ Mailgun mailgun+smtp://USERNAME:PASSWORD@default mailgun+http://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default
100
+ Postmark postmark+smtp://ID:ID@default n/a postmark+api://KEY@default
101
+ Sendgrid sendgrid+smtp://apikey:KEY@default n/a sendgrid+api://KEY@default
102
+ ==================== ========================================== ========================================== ========================================
103
+
104
+ Instead of choosing a specific protocol, you can also let Symfony pick the
105
+ "best" one by omitting it from the scheme: for instance,
106
+ ``mailgun://KEY:DOMAIN@default `` is equivalent to
107
+ ``mailgun+http://KEY:DOMAIN@default ``.
101
108
102
109
Failover Transport
103
110
------------------
104
111
105
112
You can create failover transport with the help of `|| ` operator::
106
113
107
- $dsn = 'api://id@postmark || smtp://key@sendgrid ';
114
+ $dsn = 'postmark+ api://ID@default || sendgrid+ smtp://KEY@default ';
108
115
109
116
So if the first transport fails, the mailer will attempt to send through the
110
117
second transport.
@@ -115,7 +122,7 @@ Round Robin
115
122
If you want to send emails by using multiple transports in a round-robin fashion,
116
123
you can use the ``&& `` operator between the transports::
117
124
118
- $dsn = 'api://id@postmark && smtp://key@sendgrid'
125
+ $dsn = 'postmark+ api://ID@default && sendgrid+ smtp://KEY@default';
119
126
120
127
Sending emails asynchronously
121
128
-----------------------------
0 commit comments