Send email with attached PDF File Monitor

Discuss RoboTask here
Post Reply
Charlyro222
Posts: 2
Joined: Thu Jun 25, 2020 8:34 am

Send email with attached PDF File Monitor

Post by Charlyro222 »

Hi:

I´d like to know if there is an easy way to File Monitor a folder and as soon as a file with wilcard like *Portada*.PDF send an email with the attached file.
After that delete all files in folder.

Thank´s in advance
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Send email with attached PDF File Monitor

Post by Oleg »

I think that you can create the task like this (see below)
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|1163085779
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task1225"
Hide=INTEGER|0
ID=INTEGER|161499709
LogOnAsUser=INTEGER|1
Name=STRING|"Monitor portada files"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""FOLDER"" with value ""c:\incoming"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"FOLDER"
varvalue=STRING|"c:\incoming"

[Actions\Action2]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action2\Params]
createmode=STRING|"1"
date1=STRING|"20200629"
date2=STRING|"20200629"
destvar=STRING|"FILENAME"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{folder}\*portada*.pdf"
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\Action3]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email"
Params=FOLDER

[Actions\Action3\Params]
attach0=STRING|"{filename}"
attachcount=STRING|"1"
auth=STRING|"0"
charset=STRING|"iso-8859-1"
from=STRING|"user@host.com"
host=STRING|"host.com"
html=STRING|"0"
msg0=STRING|"Look PDF in attachment"
msgcount=STRING|"1"
password=STRING|"2591325713264762545426990"
port=STRING|"25"
priority=STRING|"1"
receipt=STRING|"0"
SSL=STRING|"0"
subject=STRING|"New portada file"
to=STRING|"user@destination.com"
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|"{filename}"
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"
Name=STRING|"File Monitor"
Params=FOLDER
UniqueID=INTEGER|-1104217145

[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"c:\incoming"
foldercount=STRING|"1"
incmask=STRING|"*portada.pdf"
interval=STRING|"60"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
pass=STRING|"0"
passmode=STRING|"1"
required=STRING|"0"
saveresults=STRING|"0"
subfolders1=STRING|"0"

Oleg Yershov
Post Reply