Hello and Good Day! I am new to robotask and need help with the following.
I need to create a task that does the following.
01. Watch folder for new items. c:\toemail
02. Extract all text from record c:\toemail\01.txt
03. Write that extracted data to the body of an email.
04. Send the email. (mailto:whoever@yahoo.com)
05. Delete text file c:\toemail\01.txt
06. Loop until each text file has been read, extracted, emailed, & deleted.
07. Wait & watch for new items. (repeat again)
I don't know how many text files I may have in the folder, we may have up to 20 at one time which would be 20 emails.
Thanks in advance
David
Extracting text file to body of an email
Re: Extracting text file to body of an email
Just look at my example.
This task sends all TXT files to whoever@yahoo.com from folder c:\toemail
File monitor trigger detects new TXT file in the folder and launches the task automatically.
You need only to copy necessary files to folder c:\toemail
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Do not forget to enable the task after importing.
This task sends all TXT files to whoever@yahoo.com from folder c:\toemail
File monitor trigger detects new TXT file in the folder and launches the task automatically.
You need only to copy necessary files to folder c:\toemail
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Do not forget to enable the task after importing.
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task65"
Hide=INTEGER|0
ID=INTEGER|188144622
LogOnAsUser=INTEGER|1
Name=STRING|"Send texts via email"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER
[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20150406"
date2=STRING|"20150406"
destvar=STRING|"BODYTEXT"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"c:\toemail\*.txt"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_FILE_WAIT"
Enabled=INTEGER|-1
Name=STRING|"Waiting {BodyText} file for 60 sec"
Params=FOLDER
[Actions\Action2\Params]
filename=STRING|"{BodyText}"
timeout=STRING|"60"
[Actions\Action3]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email"
Params=FOLDER
[Actions\Action3\Params]
attachcount=STRING|"0"
auth=STRING|"0"
charset=STRING|"iso-8859-1"
from=STRING|"whoever@yahoo.com"
host=STRING|"my_smtp_server.com"
html=STRING|"0"
msg0=STRING|"{TextFile({BodyText})}"
msgcount=STRING|"1"
password=STRING|"2565726990246892570624689"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"The text {bodytext}"
xmailer=STRING|"RoboTask"
[Actions\Action4]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER
[Actions\Action4\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{BodyText}"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"0"
[Actions\Action5]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER
UnigueID=INTEGER|565518369
[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"1"
folder1=STRING|"c:\toemail\"
foldercount=STRING|"1"
incmask=STRING|"*.txt"
interval=STRING|"60"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
pass=STRING|"0"
passmode=STRING|"1"
saveresults=STRING|"0"
subfolders1=STRING|"0"
Oleg Yershov
Re: Extracting text file to body of an email
Thanks for the help!!
This is the error message I am getting.
I: 4/6/2015 7:55:17 AM: ****** Starting task: Send texts via email (imported) ******************
I: 4/6/2015 7:55:17 AM: Executing "1.File Loop"
I: 4/6/2015 7:55:17 AM: Executing "2.Waiting {BodyText} file for 60 sec"
E: 4/6/2015 7:55:17 AM: File "{BodyText}" doesn't exist
E: 4/6/2015 7:55:17 AM: An error occurred. Step #2 (Waiting {BodyText} file for 60 sec).
E: 4/6/2015 7:55:17 AM: Task execution is aborted
This is the error message I am getting.
I: 4/6/2015 7:55:17 AM: ****** Starting task: Send texts via email (imported) ******************
I: 4/6/2015 7:55:17 AM: Executing "1.File Loop"
I: 4/6/2015 7:55:17 AM: Executing "2.Waiting {BodyText} file for 60 sec"
E: 4/6/2015 7:55:17 AM: File "{BodyText}" doesn't exist
E: 4/6/2015 7:55:17 AM: An error occurred. Step #2 (Waiting {BodyText} file for 60 sec).
E: 4/6/2015 7:55:17 AM: Task execution is aborted
Re: Extracting text file to body of an email
I was able to get it to work by changing BODYFILE to BODYTEXT
Re: Extracting text file to body of an email
Yes, of course. This is my mistake. Variable name should be BODYTEXT at 1-st step.TWSI wrote:I was able to get it to work by changing BODYFILE to BODYTEXT
I have corrected the task in my message
Oleg Yershov