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 set timeout with Swiftmailer?
- How to use SMTP with Swiftmailer?
- How to use TLS 1.2 with Swiftmailer?
- How to get the response code when using Swiftmailer?
- How to use Swiftmailer to send RFC 2822 compliant emails?
- How to configure Swiftmailer for Postfix?
- How to send emails in UTF8 using Swiftmailer?
- How to send emails to multiple recipients with Swiftmailer?
- How to set the port for Swiftmailer?
- How to enable TLS with Swiftmailer?
See more codes...