Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead
Asked Answered
N

2

10

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.

Console screen

Nephogram answered 25/11, 2021 at 4:44 Comment(6)
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.Akmolinsk
It'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?Metaplasm
@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.Akmolinsk
It 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.Metaplasm
@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.Akmolinsk
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)Propellant
N
4

after long time i got the solution. That is :- This is just a package. You can avoid this things.. this is Nothing. Thanks

Nephogram answered 24/2, 2022 at 19:12 Comment(0)
T
-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([‘[email protected]’ => ‘John Doe’])
->setTo([‘[email protected]’, ‘[email protected]’ => ‘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’);
Tolerant answered 6/1, 2022 at 16:33 Comment(2)
The 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.Akmolinsk
This answer is most irrelevant answer I have seen todayWord

© 2022 - 2024 — McMap. All rights reserved.