php-swiftmailerHow to set the 'from' address in Swiftmailer?
The 'from' address in Swiftmailer can be set using the setFrom() method.
$message->setFrom('[email protected]', 'Sender Name');
The setFrom() method takes two parameters:
- The email address of the sender.
- The name of the sender.
The setFrom() method should be called before the send() method.
For more information, please refer to the Swiftmailer documentation.
More of Php Swiftmailer
- How to use SMTP with Swiftmailer?
- How to use TLS 1.2 with Swiftmailer?
- How to set timeout with Swiftmailer?
- How to ignore a certificate when using Swiftmailer?
- How to configure Swiftmailer for SMTP without authentication?
- How to use Swiftmailer transport?
- How to enable TLS with Swiftmailer?
- How to set the port for Swiftmailer?
- How to send multiple attachments with SwiftMailer?
- How to add CC to an email using Swiftmailer?
See more codes...