ppkarwasz opened a new issue, #3704:
URL: https://github.com/apache/logging-log4j2/issues/3704

   Currently, the [SMTP 
Appender](https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SmtpAppender)
 does not support adding custom headers to outgoing email messages. In 
contrast, the [HTTP 
Appender](https://logging.apache.org/log4j/2.x/manual/appenders/network.html#HttpAppender)
 allows users to define custom headers using `<Property>` elements. Introducing 
similar support for the SMTP Appender would enhance feature parity across 
appenders and improve user experience and flexibility.
   
   ### Proposed Solution
   
   Both the HTTP and SMTP Appenders extend `AbstractFilterable` and already 
support `<Property>` configuration elements. In the HTTP Appender, these 
`<Property>` elements are interpreted as HTTP headers. Similarly, the SMTP 
Appender could treat `<Property>` entries as custom email headers.
   
   **Example:**
   
   ```xml
   <Appenders>
     <SMTP name="Email" ...>
       <Property name="X-Custom-ID">12345</Property>
       <Property name="Reply-To">nore...@example.com</Property>
     </SMTP>
   </Appenders>
   ```
   
   This change would preserve existing behavior while enabling greater 
customization for advanced email use cases.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to