How to add hostname value in email subject or body

A few discussions + examples: