Reputation: 305
I am trying to verify login credentials with SwiftMailer in Laravel. I need to verify the login credentials to an SMTP server without actually sending the email.
I am trying to do something like this:
$client = Swift_SmtpTransport::newInstance($smtpServer, $smtpPort, 'ssl');
$client->setUsername($this->smtpUser);
$client->setPassword($this->smtpPass);
$client->authenticate();
There is no authenticate()
method on the Swift_SmtpTransport
but it would be great if there was something similar I could use.
I can't find a suitable function in the source: https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Transport/AbstractSmtpTransport.php
Is there a way to just try and verify authentication on an SMTP server using SwiftMailer without having to send the email?
Upvotes: 4
Views: 2058