How to use <mail> plugin to send emails?

How to use Webharvest IDE plugin to send emails? we have samples in KB, but not working.

<mail smtp-host="smtp server" 
      smtp-port="smtp server port" 
      type="content type"
      reply-to="reply-to header"
      username="smtp username"
      password="smtp password"
      security="smtp security type">
    mail content with optional attachments (mail-attach elements)

This code is not working and it says 'javax.mail.MessagingException: Could not connect to SMTP host: eventhough mail server is valid and running on port 25.

Caused by: javax.mail.MessagingException: Could not connect to SMTP host: ;
nested exception is: Permission denied: connect

Hi @venkata.saripella,

To use this plugin, you need to enter your real SMTP server (for example, port (465), and credentials.


Thank You. I will try,

This is what I tried.

It is not exactly with real SMTP server. It worked directly when i am sending email from Linux box to email server (Linux Box). Earlier I was trying to send email from windows box which is controlled by fire wall. Thank You anyway,

One more question: how to send variables to body of the email. for example I have variable string abcd having some value and i want to add variable abcd to the body of the email. I tried adding ${} same way as Subject. Subject is working, but body it is not working.

hi @venkata.saripella

try the standard <var> webharvest plugin:

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


	<var-def name="abcd">

	<mail smtp-host="" 
        mail content text and your variable value:  
        <var name="abcd"/>
1 Like

Thank You I will try.

Thank You, It worked.

I want to send html content in email body. for example


This is not working. do you have any idea?


It can be done by changing the “type” to “html” and using the CDATA for your html code:

<var-def name="abcd">
<mail ............... 
  type="html" .........>
	Using HTML content in your email:
    	<p><a href="">WorkFusion Inc.</a> is providing <strong>SPA*</strong></p>

    *<var name="abcd"/> - Smart Process Automation

1 Like


Let’s post a quick how-to based on this discussion and link here.

thank you, will try.

@mabramchik, @venkata.saripella,

Here is a how-to in our knowledge base:

1 Like

Also another way to resolve variables in email body (or any other element which takes body text as content) is to use <template> tag:

<mail ...>
        Execution report for week ${execution_week} of ${execution_year}:
            Number of records processed: ${number_of_records}
            Processed automatically: ${processed_by_machine}
            Processed by human force: ${processed_by_human}
            Report Generation Date: ${new Date()}

How can I get access to the knowledge base article? The login from the forum don´t work with the knwoedge base

@yves_deja - see this topic - How to register an account to login Workfusion Knowledge Base?

I had an list array and I want to write this array into a file and mail it. But, here I don’t have s3 bucket to write array into some file in S3 and mail the path of the file. Also, I cant save the file in local drive, because here rpa server is windows and application server is Linux. I cant access file from windows to Linux. could you please suggest the solution.

Hi, I am trying to connect to SQL server and run a sql query to get some value, Which I have working in eclipse using java and sqljdbc driver like a charm. In Workfusion RPA, so far I have understood after going through this forum it can not be accomplished with java or groovy code. Instead Web-Harvest Processor has to be used. So would you point me to documentation or guide for the steps I need to follow to implement Web-Harvest Processor and use in Custom Action.