-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Ability to start & stop SMTP connection when needed #43237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related to this missing possibility to manually stop a transport, is in long running jobs/workers where it only ever sends emails occasionally, you will end up having a constant connection open towards an SMTP server. Not all servers like this, so in changing over from swiftmailer, we are currently debating whether we need to destroy the mailer after each iteration since the stop() method is called in the destructor. |
Looks like a legit use case indeed. Is anyone willing to make start/stop methods public in a PR for 6.1? |
I am willing to give it a go today :-) |
…ersted) This PR was merged into the 6.1 branch. Discussion ---------- [Mailer] Allow manually stop() of SmtpTransport | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #43237 | License | MIT | Doc PR | Mark the `stop()` method on SmtpTransport as public, to allow greater control in long running jobs and similar. Commits ------- ac6c519 [Mailer] Allow manually start()/stop() of SmtpTransport
Hi @fabpot is there an equivalent for 5.4 symfony LTS version? |
@jul6art You'll need to update the component to Symfony 6. |
Description
I am using Mailer in Messenger worker long lived process with AWS SES SMTP interface and it keep throwing error:
I know i can get rid of this error by setting
ping_threshold: 0
but it is not efficient since the transport have to ping server on every email sending out. It is better to manually stop transport connection when Messenger message get handled (with all emails are sent out) and it will auto start on next message handling. But the problem is SmtpTransportstart
&stop
methods are private and i have no way to access them.The text was updated successfully, but these errors were encountered: