Attach multiqc report to sendMail

Good afternoon! I’m trying to use built-in function sendMail:

mail = [
    to: 'you@gmail.com',
    subject: 'Catch up',
    body: 'Hi, how are you!',
    attach: '/some/path/attachment/file.txt'
]

sendMail(mail)

However, I cannot correctly transfer the multiqc report to the attach block:
I tried it like this:

process MULTIQC {
    //conda 'multiqc'
    conda "/export/home/agletdinov/mambaforge/envs/multiqc"
    
    tag "MultiQC"
    publishDir "${params.outdir}/multiqc", mode:'copy'

    input:
    path("*")

    output:
    path("multiqc_report.html")

    script:
    """
    multiqc .
    """
}
process SENDMAIL {
    tag "sendMail"

    input:
    path(to_html)

    script:
    mail = [
        to: 'example@gmai.com',
        subject: 'example',
        body: 'Report',
        attach: to_html
    ]

    sendMail(mail)
}
workflow taxonomy_analysis_reads{
    ********
    MULTIQC(TAXONOMY_ANALYSIS.out)
    SENDMAIL(MULTIQC.out)
}

I get the following error:

ERROR ~ Error executing process > 'taxonomy_analysis_reads:SENDMAIL (sendMail)'

Caused by:
  java.nio.file.ProviderMismatchException -- Check script './modules/sendMail.nf' at line: 15

I tried to use sendMail immediately in the workflow block, but I also got an error.
How can I do this correctly?
Thank you in advance!

p.s. The SMTP server is configured correctly