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 set the 'from' address in Swiftmailer?
- How to use TLS 1.2 with Swiftmailer?
- How to use Swiftmailer to send RFC 2822 compliant emails?
- How to set the port for Swiftmailer?
- How to configure Swiftmailer for Postfix?
- How to set the sender name in SwiftMailer?
- How to send emails without encryption in SwiftMailer?
- How to send multiple attachments with SwiftMailer?
See more codes...