@@ -25,6 +25,9 @@ Installation
25
25
Introduction
26
26
------------
27
27
28
+ Symfony mailer is an experimental component introduced in 4.3 which
29
+ will eventually replace swiftmailer.
30
+
28
31
29
32
Usage
30
33
-----
@@ -47,14 +50,18 @@ By default, the only transport available in the mailer component is Smtp.
47
50
48
51
Below is the list of other popular providers with built in support.
49
52
50
- - Amazon SES: ``symfony/amazon-mailer ``
51
- - Google Gmail: ``symfony/google-mailer ``
52
- - Mandrill: ``symfony/mailchimp-mailer ``
53
- - Mailgun: ``symfony/mailgun-mailer ``
54
- - Postmark: ``symfony/postmark-mailer ``
55
- - Sendgrid: ``symfony/sendgrid-mailer ``
53
+ ================== =============================================
54
+ Service Install with
55
+ ================== =============================================
56
+ Amazon SES ``composer require symfony/amazon-mailer ``
57
+ Gmail ``composer require symfony/google-mailer ``
58
+ MailChimp ``composer require symfony/mailchimp-mailer ``
59
+ Mailgun ``composer require symfony/mailgun-mailer ``
60
+ Postmark ``composer require symfony/postmark-mailer ``
61
+ SendGrid ``composer require symfony/sendgrid-mailer ``
62
+ ================== =============================================
56
63
57
- For example to use google 's gmail as a transport you need to install symfony/google-mailer.
64
+ For example, suppose you want to use Google 's Gmail. First, install it:
58
65
59
66
.. code-block :: terminal
60
67
@@ -68,16 +75,16 @@ For example to use google's gmail as a transport you need to install symfony/goo
68
75
$mailer = new Mailer($transport);
69
76
$mailer->send($email);
70
77
71
- Use a Dsn
78
+ Use a DSN
72
79
---------
73
80
74
- The mailer component provides a convenient way to create transport object from dsn string::
81
+ The mailer component provides a convenient way to create transport object from DSN string::
75
82
76
83
use Symfony\Component\Mailer\Transport;
77
84
78
85
$transport = Transport::fromDsn($dsn);
79
86
80
- Where ``$dns `` as one of the form below.
87
+ Where ``$dsn `` as one of the form below.
81
88
82
89
- ``smtp://user:pass@gmail ``
83
90
- ``smtp://key@sendgrid ``
@@ -87,7 +94,7 @@ Where ``$dns`` as one of the form below.
87
94
- ``api://id@postmark ``
88
95
89
96
This provides a unified behaviour across all providers.
90
- Easily switch from SMTP in dev to a "real" provider in production with same API.
97
+ Easily switch from SMTP in development to a "real" provider in production with same API.
91
98
92
99
Failover transport
93
100
------------------
@@ -145,4 +152,4 @@ Then, instantiate and pass a ``MessageBus`` as a second argument to ``Mailer``::
145
152
[
146
153
new Address('recepient@example.com'),
147
154
]
148
- ));
155
+ ));
0 commit comments