Ensure that your Jenkins has email-ext-plugin installed. If not, refer this and install it first.
Follow below steps to embed html file in email content:
- Go to your jenkins job and click on Configure.
- Go to Post Build Actions and then select Editable Email Notifications
- Select Content Type as HTML(text/plain)
- In the default content section replace $DEFAULT_CONTENT with following
For example, below is the absolute path for your html file. So you just need to pick bold marked as relative path and mention in path.
This will place the surefire-report.html content in your email body.
Hope this tip is helpful for you.