Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a proper way to add NTLM auth type into SwiftMailer using SwiftMailer bundle in symfony?

I have symfony project with swiftMailer bundle. I was trying to send email via swiftmailer using NTLM auth. But I have not found a way to turn on NTLM via configuration of the bundle.

After struggling with it I have found solution

First solution

current($this->get('mailer')->getTransport()->getExtensionHandlers())
    ->setAuthenticators([new \Swift_Transport_Esmtp_Auth_NTLMAuthenticator()]);

Comment spool in config.yml

#    spool:     { type: memory }

But it's look a little bit weird.

Second solution

Remove SwiftMailer bundle and use swiftMailer directly, because ntlm auth type activated by default.

Is there a better way to use NTLM auth type?

like image 397
sectus Avatar asked Apr 05 '16 06:04

sectus


1 Answers

I created pull request which got approved.

Since version v3.0.4 you can use

  auth_mode: ntlm

You can install v3.0.4 version using command

composer require symfony/swiftmailer-bundle:^3.0.4
like image 90
mleko Avatar answered Oct 09 '22 19:10

mleko