run through a list of filenames and email

Discuss RoboTask here
Post Reply
deesloop
Posts: 70
Joined: Wed Feb 25, 2009 3:44 am

run through a list of filenames and email

Post by deesloop »

i have some files In a folder.
They are all date_xxxx_costs.pdf
What I want to do is run through the list and email each file indivudally to
xxxxfile@domain.com
I was thinking of using a variable emailto
then using strextra grab characters 12-15 and assign that string to the variable emailto
Then ammend emailto variable to be emailto & "domain.com"

I'm struggline to do this though
Can a variable be set to the value and then manipulated a string?
Oleg
Site Admin
Posts: 3105
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: run through a list of filenames and email

Post by Oleg »

Send several examples of the real file names.
I will try to write the example but I need to test it on real names.
There may be some nuances.
Oleg Yershov
Oleg
Site Admin
Posts: 3105
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: run through a list of filenames and email

Post by Oleg »

See the example below.
This will be something similar to this:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2099193306
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task667"
Hide=INTEGER|0
ID=INTEGER|1759461252
LogOnAsUser=INTEGER|1
Name=STRING|"Send files individually"
OnErrorTaskID=INTEGER|0
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
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FOLDER"" with value ""D:\incoming\pdf\"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FOLDER"
varvalue=STRING|"D:\incoming\pdf\"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""CFILE"" with value """""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"CFILE"

[Actions\Action3]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""PART"" with value """""
Params=FOLDER

[Actions\Action3\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"PART"

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

[Actions\Action4\Params]
createmode=STRING|"1"
date1=STRING|"20130919"
date2=STRING|"20130919"
destvar=STRING|"CFILE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{folder}\*.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|"1"

[Actions\Action5]
ActionID=STRING|"A_STR_BETWEEN"
Enabled=INTEGER|-1
Name=STRING|"STR Between"
Params=FOLDER

[Actions\Action5\Params]
begin=STRING|"_"
case=STRING|"0"
end=STRING|"_"
save=STRING|"0"
source=STRING|"{cfile}"
startpos=STRING|"1"
variable=STRING|"part"

[Actions\Action6]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{part}file@domain.com"""
Params=FOLDER

[Actions\Action6\Params]
icon=STRING|"1"
msg0=STRING|"{part}file@domain.com"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action7]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|0
Name=STRING|"Send Email"
Params=FOLDER

[Actions\Action7\Params]
attach0=STRING|"{cfile}"
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|"See file in attacment {cfile}"
msgcount=STRING|"1"
password=STRING|"2616924941259692596116055"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"Enter subject"
to=STRING|"{part}file@domain.com"

[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Also look at the step #7 (send email) You can enable it and correct parameters to necessary values.
But mechanism will be the same.
Oleg Yershov
Post Reply