'EmailExt- Jenkinsfile - HTML and CSS files are not embedded

EmailExt- Jenkinsfile - HTML and CSS files are not embedded

I am trying to attach html report in the email body and send the mail using Email-ext plugin.

 email-ext attachmentsPattern: "filePathToBeAttached", mimeType:'text/html', body: readFile("${env.WORKSPACE}/path_to_report.html"),to: [email protected]", subject:"test report"

But I could see plain HTML without proper formatting and absence of CSS styling in the email report sent.

Any help pls.



Solution 1:[1]

This is currently working for me. HTML is properly formatted in the mail, in outlook. I'm not using any css.

            unsuccessful {
            emailext mimeType: 'text/html',
            subject: "${PROJECT_NAME} - Build # ${BUILD_NUMBER} - ${BUILD_STATUS}!",
            body: readFile("${env.WORKSPACE}/JenkinsMailBody.html"),
            from: '[email protected]',
            replyTo: '[email protected]',
            recipientProviders: [culprits(), requestor()]
            }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user10888153