-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Mailer timeout #35138
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
This is not bug. The timeout is default 5 second defined in: There is no configuration here to set this time nor any setter. Increase value anyway. |
@seddighi78 can you confirm temporary solution ? |
@michaljusiega I'm using a try-catch to control the throws of the mailer. the mail was successfully sent but time out happened. |
Yes because your SMTP server probably analyze your mail too slowly so you got a exception for this reason. |
Do I have to wait for this problem or is there a right solution? |
@seddighi78 this is not a bug, as @michaljusiega has mentioned, your server is taking too long to responed and symfony mailer is timing out. if you want to increase the timeout, you can do so using : $transport->getStream()->setTimeout($timeoutInSeconds); |
@azjezz How can i change timeout from event listener or controller? I can't change timeout from configuration |
I would highly recommend to fix the latency of the server if possible. If not, configure |
…(azjezz) This PR was merged into the 5.1-dev branch. Discussion ---------- [Mailer] read default timeout from ini configurations | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | #35138 | License | MIT | Doc PR | n/a ```env MAILER_DSN=mandrill+https://foo@default?timeout=30 ``` Commits ------- dafb057 [Mailer] read default timeout from ini configurations
Thank you @fabpot |
The only way of solving this in 4.4 is creating a custom factory that configures the timeout of the socket ? |
Here's my problem with this: Application is running on Symfony 5.0 and files between 3-4 MB need to get attached. In the development environment, we are using Mailhog on a Docker container - the former being notoriously slow at processing emails with attachments. In this scenario, we are getting a |
I solved it for v4.4 by setting timeout in the decorated EsmtpTransportFactory::create method. |
Symfony version(s) affected: 4.4.2
Description
I'm using Mailer component for send email in Symfony and set env variables for MAILER_DSN
the emails was send but throw error for timeout:
i think this is bug or if not please help to solve this.
thanks
The text was updated successfully, but these errors were encountered: