I can't install breez and npm for this situation. What should I do to solve this problem? When I'm going to create a laravel project show this and breez install time too.
Asked
Active
Viewed 4.0k times
9
-
The SwiftMailer is still used extensively. Are you only concerned because of the warning? Are you planning to write code using a mail package? It appears you are using Laravel, so that will become a valid point with Laravel 9. Add context to your question to get a good answer. – John Hanley Nov 25 '21 at 07:46
-
2It's pretty weird that a fresh new Laravel project gives you this warning. It looks bad and it's confusing. Why is Laravel still using an abandoned email package? – Andrew Koster Dec 01 '21 at 01:35
-
3@AndrewKoster - There are many very popular projects that are abandoned. Abandoned does not mean **bad**, it means that the person running the project is no longer actively developing or improving the project. One of the benefits open source is that you can clone/modify a project to fit your needs. Laravel has been using the mail package for years. To change the mail package would be a breaking change. That is one of the reasons for Laravel 9. A major number change implies breaking changes. – John Hanley Dec 01 '21 at 01:53
-
12It literally says "you should avoid using it", about itself, and recommends a specific replacement. I really think that people should stop using it ASAP, based on what it says about itself. – Andrew Koster Dec 01 '21 at 02:59
-
4@AndrewKoster - I have years of experience with the library and I have no problem continuing to use it for Laravel 8. The cost and pain for current Laravel 8 and prior users to switch are not practical. Opinions vary. Once Laravel 9 is released the Symphony mailer will be the default. You of course are free to use Symphony today but not with Laravel 8. – John Hanley Dec 01 '21 at 03:34
-
Use this command to see why you can't just use the new package: ```composer why swiftmailer/swiftmailer laravel/framework v8.83.23 requires swiftmailer/swiftmailer (^6.3)``` – Eugene van der Merwe Aug 10 '22 at 20:47
2 Answers
4
after long time i got the solution. That is :- This is just a package. You can avoid this things.. this is Nothing. Thanks

Rajib Bin Alam
- 353
- 1
- 4
- 16
-11
$ composer require “swiftmailer/swiftmailer:^6.0” Here is the simplest way to send emails with Swift Mailer:
require_once ‘/path/to/vendor/autoload.php’;
// Create the Transport
$transport = (new Swift_SmtpTransport(‘smtp.example.org’, 25))
->setUsername(‘your username’)
->setPassword(‘your password’)
;
// Create the Mailer using your created Transport $mailer = new Swift_Mailer($transport);
// Create a message
$message = (new Swift_Message(‘Wonderful Subject’))
->setFrom([‘john@doe.com’ => ‘John Doe’])
->setTo([‘receiver@domain.org’, ‘other@domain.org’ => ‘A name’])
->setBody(‘Here is the message itself’)
;
// Send the message
$result = $mailer->send($message);
You can also use Sendmail as a transport:
// Sendmail
$transport = new Swift_SendmailTransport(‘/usr/sbin/sendmail -bs’);
-
7The question is tagged Laravel. Have you tested your answer with Laravel? There are many tools built into Laravel that will not support your answer. This also will not work with existing Laravel 8 and prior setups. – John Hanley Jan 07 '22 at 03:10
-
3