php-swiftmailerHow to configure Swiftmailer for SMTP without authentication?
Swiftmailer can be configured for SMTP without authentication by setting the transport
option to smtp
and providing the host
, port
and encryption
options.
$transport = (new Swift_SmtpTransport('smtp.example.com', 25))
->setEncryption('tls')
->setTimeout(30);
The host
option should be set to the SMTP server address, the port
option should be set to the port number of the SMTP server and the encryption
option should be set to the encryption protocol used by the SMTP server.
host
: SMTP server addressport
: port number of the SMTP serverencryption
: encryption protocol used by the SMTP server
Helpful links
More of Php Swiftmailer
- How to use SMTP with Swiftmailer?
- How to use TLS 1.2 with Swiftmailer?
- How to send emails in UTF8 using Swiftmailer?
- How to set timeout with Swiftmailer?
- How to get the response code when using Swiftmailer?
- How to use Swiftmailer with Symfony?
- How to set the reply to address in Swiftmailer?
- How to set the port for Swiftmailer?
- How to encrypt emails with SwiftMailer?
- How to send emails to multiple recipients with Swiftmailer?
See more codes...