Search code examples
emailsymfonysmtpxdebugswiftmailer

Symfony2 Swift Mailer connection time extremely long - Debug options?


I'm using Symfony 2.1 and SwiftMailer to send out registration e-mails. The process handling for this takes abouts 20 seconds if there's an email to be send. Meanwhile the website is loading. This might give users the impression that something went wrong.

I'm connecting using SMTP.

I have a similar Symfony2 Installation which connects to the same mail server, also using SMTP and there an email is send immediately.

Is there a way using XDEBUG or something else to see what is causing the delay?


Solution

  • I think this was a slow DNS lookup problem. In parameters.yml I've changed the SMTP host from the domain name to 127.0.0.1 and it works perfectly now.