How to send Mail with attachment



Good Day!

In my current project I am using web harvest mail tag to send a mail with attachment(.xlsx/.pdf). whenever we attach some attachment, we can receive only a file format.

Can you please guide me in getting correct file format.

  <mail smtp-host="mail.xxxx.xx.xx"
      HI, i am just testing email process
    <mail-attach name="VAF" mimetype="application/octet-stream">
      <file path="C:/Users/C738624/Desktop/VAF.xml" type="binary"/>

Sending mail via RPA Express
Send email with custom script (groovy)
Resolve HTML Template


Here is a working example:

        <?xml version="1.0" encoding="UTF-8"?>
        <config xmlns="">

        	<mail smtp-host="" 
            	mail content  
            <mail-attach name="application.pdf" mimetype="application/octet-stream">
              <file path="c:\Users\azinchuk\Downloads\application.pdf" type="binary"/>

     <!-- Or use relative URL (from your configs folder):  -->

            <mail-attach name="input.csv" mimetype="application/octet-stream">
              <file path="..\input\input_data_file.csv" type="binary"/>
            <export include-original-data="true"></export>

Can we send email with attachment in RPA Express

Thank you tested and working… Appreciated


I have a scenario to attach a file to a mail which we are sending via plugin in WF (reference takne from this forum post:

What I am doing is creating a file in the WF server and then give that file location to the “File plugin” using “path” attribute, similar to below code snippet, and then deleting the file from the file system.

My questions are:

  1. Is this a correct approach to do this, considering we will be creating a file in the file system of WF server? If not please explain the correct way of doing this.

  2. Is it possible to provide a URI ( e.g: S3 location) to the “path” attribute of the “file” plugin?



The file needs to be located on WF server if you are executing the bot task from the Control Tower web application.

The given example has local path because it is a training example and it is executed from WF Studio on a local machine.

You can attach any binary data - see

If you want to download a file via http, you can use the following code:

<file action="write" path="123.txt">
    <http-extended url="https://s3-file-link" method="GET" content-type="application/json">


Thank you for the reply. I am using the control tower web application. Is there a specific directory within the WorkFusion server which we can use to download these temporary files to? Or is it okay if the file path is set to any directory we wish?



it is better to use the /tmp folder. But do not forget to clean this folder on a regular basis.


I am trying to send mail with attachment .I am getting “Error reading file: C:/download.jpg”.Though file exists in this path the error is mentioned as file doesn’t not exists.Can you please help me to resolve this issue.