From 263ce6b8f8be7f9330ef2e7b2204951a2d72b6bb Mon Sep 17 00:00:00 2001 From: sergiu Date: Mon, 18 Nov 2024 15:17:48 +0200 Subject: [PATCH 1/3] cleaned config file, updated documentation, and display from name corectly --- config/mail.global.php.dist | 4 ---- docs/book/v4/transports.md | 2 +- docs/book/v5/configuration.md | 7 ------- docs/book/v5/transports.md | 2 +- src/Factory/MailServiceAbstractFactory.php | 2 +- test/CommonTrait.php | 13 ------------- 6 files changed, 3 insertions(+), 27 deletions(-) diff --git a/config/mail.global.php.dist b/config/mail.global.php.dist index fc90aa3..f9fd1f3 100644 --- a/config/mail.global.php.dist +++ b/config/mail.global.php.dist @@ -27,10 +27,6 @@ return [ 'transport' => Symfony\Component\Mailer\Transport\Smtp\SmtpTransport::class, - // Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder - // Valid only if the Transport is SMTP - //'save_sent_message_folder' => ['INBOX.Sent'], - //message configuration 'message_options' => [ diff --git a/docs/book/v4/transports.md b/docs/book/v4/transports.md index 406f0e9..049cd17 100644 --- a/docs/book/v4/transports.md +++ b/docs/book/v4/transports.md @@ -9,7 +9,7 @@ > Feel free to use any custom transport you desire, provided it implements the mentioned `TransportInterface`. -`Sendmail` is a wrapper over PHP's `mail()` function, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with** `addBcc()`. +PHP's `mail()` function is a wrapper over `Sendmail`, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with** `addBcc()`. - Note: emails sent using the sendmail transport will be more often delivered to SPAM. diff --git a/docs/book/v5/configuration.md b/docs/book/v5/configuration.md index 93b330b..7316366 100644 --- a/docs/book/v5/configuration.md +++ b/docs/book/v5/configuration.md @@ -27,13 +27,6 @@ Sending email with the `Smtp` transport requires valid data for the values under > The configured path must be a writable directory -```php -'file_options' => [ - 'path' => 'data/mail/output', - //'callback' => null, -], -``` - ## Logging configuration Uncommenting the `dot-mail.log` key will save a copy of all sent emails' subject, recipient addresses, cc and bcc addresses alongside a timestamp. diff --git a/docs/book/v5/transports.md b/docs/book/v5/transports.md index bfbf844..e6301eb 100644 --- a/docs/book/v5/transports.md +++ b/docs/book/v5/transports.md @@ -7,7 +7,7 @@ > Feel free to use any custom transport you desire, provided it implements the mentioned `TransportInterface`. -`Sendmail` is a wrapper over PHP's `mail()` function, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with** `addBcc()`. +PHP's `mail()` function is a wrapper over `Sendmail`, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with** `addBcc()`. - Note: emails sent using the sendmail transport will be more often delivered to SPAM. diff --git a/src/Factory/MailServiceAbstractFactory.php b/src/Factory/MailServiceAbstractFactory.php index efa2123..b3507fd 100644 --- a/src/Factory/MailServiceAbstractFactory.php +++ b/src/Factory/MailServiceAbstractFactory.php @@ -111,7 +111,7 @@ protected function createMessage(): Email $from = $options->getFrom(); if (! empty($from)) { - $message->addFrom($from); + $message->addFrom($from, $options->getFromName()); } $replyTo = $options->getReplyTo(); diff --git a/test/CommonTrait.php b/test/CommonTrait.php index b3a6f45..4dca561 100644 --- a/test/CommonTrait.php +++ b/test/CommonTrait.php @@ -60,11 +60,6 @@ private function generateConfig(): array **/ 'transport' => SmtpTransport::class, - // Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder - // Valid only if the Transport is SMTP - // 'save_sent_message_folder' => ['INBOX.Sent'], - - // Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder // Valid only if the Transport is SMTP 'save_sent_message_folder' => ['INBOX.Sent'], 'message_options' => [ @@ -106,14 +101,6 @@ private function generateConfig(): array 'ssl' => 'tls', ], ], - - //listeners to register with the mail service, for mail events - 'event_listeners' => [ - //[ - //'type' => 'service or class name', - //'priority' => 1 - //], - ], ], // option to log the SENT emails 'log' => [ From 086c85561a69c47e36fab8d395e14410291e719b Mon Sep 17 00:00:00 2001 From: sergiu Date: Tue, 19 Nov 2024 12:54:26 +0200 Subject: [PATCH 2/3] removed useless lines --- config/mail.global.php.dist | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/config/mail.global.php.dist b/config/mail.global.php.dist index f9fd1f3..06fd745 100644 --- a/config/mail.global.php.dist +++ b/config/mail.global.php.dist @@ -25,7 +25,7 @@ return [ * defaults to sendmail **/ - 'transport' => Symfony\Component\Mailer\Transport\Smtp\SmtpTransport::class, + 'transport' => Symfony\Component\Mailer\Transport\SendmailTransport::class, //message configuration 'message_options' => [ @@ -99,14 +99,6 @@ return [ 'ssl' => 'tls', ] ], - - //listeners to register with the mail service, for mail events - 'event_listeners' => [ - //[ - //'type' => 'service or class name', - //'priority' => 1 - //], - ], ], // option to log the SENT emails 'log' => [ From a784314cccf34cfa6b0a814a3313b80d6945a5a9 Mon Sep 17 00:00:00 2001 From: sergiu Date: Tue, 19 Nov 2024 13:13:59 +0200 Subject: [PATCH 3/3] revert changes --- docs/book/v4/transports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/v4/transports.md b/docs/book/v4/transports.md index 049cd17..406f0e9 100644 --- a/docs/book/v4/transports.md +++ b/docs/book/v4/transports.md @@ -9,7 +9,7 @@ > Feel free to use any custom transport you desire, provided it implements the mentioned `TransportInterface`. -PHP's `mail()` function is a wrapper over `Sendmail`, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with** `addBcc()`. +`Sendmail` is a wrapper over PHP's `mail()` function, and as such has a different behaviour on Windows than on *nix systems. Using sendmail on Windows **will not work in combination with** `addBcc()`. - Note: emails sent using the sendmail transport will be more often delivered to SPAM.