php-swiftmailerHow to get the message ID in SwiftMailer?
The message ID in SwiftMailer can be obtained by using the getId()
method. This method returns a string containing the message ID.
Example code
$messageId = $message->getId();
Output example
<[email protected]>
Code explanation
$message
: An instance of theSwift_Message
class.getId()
: A method of theSwift_Message
class which returns the message ID as a string.
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...