php-swiftmailerHow to set the default 'from' address in Swiftmailer?
Swiftmailer allows you to set the default 'from' address for all emails sent using the library. This can be done by setting the from
property of the message
object.
$message->setFrom('[email protected]');
The setFrom()
method takes two parameters:
$address
- The email address of the sender.$name
- The name of the sender (optional).
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 the 'from' address in Swiftmailer?
- How to use Swiftmailer with Symfony?
- How to use Swiftmailer to send RFC 2822 compliant emails?
- How to configure Swiftmailer for SMTP without authentication?
- How to install Swiftmailer using Composer?
- How to send emails in UTF8 using Swiftmailer?
- How to configure Swiftmailer for Postfix?
- How to set the sender name in SwiftMailer?
See more codes...