Reputation: 61
I try to send an e-mail with Swiftmailer. But it doesn't work... This is what I tried:
$transport = Swift_SmtpTransport::newInstance('smtp.life.com', 25)
->setUsername('[email protected]')
->setPassword('the correct pasword');
I can't find the solution for solving this problem... *BTW I'm a Dutchman! ;-)
Upvotes: 2
Views: 2200
Reputation: 541
You need to set the encryption to tls as the 3rd parameter:
$transport = Swift_SmtpTransport::newInstance('smtp.life.com', 25, 'tls')
Most probably port should also be set to 587
Upvotes: 0
Reputation: 31088
530 5.7.0 Must issue a STARTTLS command first
You need to configure SwiftMailer to use a SSL connection via STARTTLS. It is supported since version 4.1.3.
Upvotes: 1