In GoAnywhere version 1.6 the best route to take is to write the Rowset variable to a CSV file just like you did and attach the CSV file to the email. You can add an attachment by clicking on the Action
menu while you are on the Send Email
task and select the Add Attachments
If you would rather have the contents of the Rowset placed into the body of the email message without using an attachment then I would recommend upgrading to 2.0. The newer version has an additional task called Set Variable
. In your case you will still need to write the CSV file first. Then you can use the Set Variable
task to set a variable to the contents of that new file. In your email task you would simply refer to this new variable and the contents of the file (which is your Rowset data) will be placed into the body of the email message.
If you go this direction it is important to note that the Set Variable
task will read in the entire contents of the file and store it into memory. If the file is large you will need to determine whether GoAnywhere is allocated enough memory to support it.
If you choose to upgrade to version 2.x here is an example project that will send an email with the contents of the file in the email body.
Code: Select all
<project name="RowsetEmail" mainModule="Main" version="1.0">
<setVariable name="data" inputFile="/linoma/goanywhere/userdata/documents/administrator/xml/EMP.csv" />
<sendEmail resourceId="Linoma SMTP Server" toList="firstname.lastname@example.org">
<from address="email@example.com" />