Page 1 of 1

Mail Object

Posted: Tue Jul 07, 2015 5:22 pm
by marcolobaido
Hi everybody,
can robotask check mails containing the word "POS" into the object and download the attached files in a folder named with the sender email addres ?
i hope my request is clear :)

Re: Mail Object

Posted: Wed Jul 08, 2015 10:57 am
by Oleg
Look at this example

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
ExternalName=STRING|"Task1285"
Hide=INTEGER|0
ID=INTEGER|1172455680
LogOnAsUser=INTEGER|1
Name=STRING|"Check email and save attachment"
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
Action6=FOLDER

[Actions\Action1]
ActionID=STRING|"A_IMAP_OPEN"
Enabled=INTEGER|-1
Name=STRING|"IMAP Open"
Params=FOLDER

[Actions\Action1\Params]
folder=STRING|"INBOX"
host=STRING|"imap.yourserver.com"
password=STRING|"46696457714449445245462874500319392"
passwordmode=STRING|"0"
port=STRING|"993"
SSL=STRING|"1"
user=STRING|"username"

[Actions\Action2]
ActionID=STRING|"A_IMAP_LOOP"
Enabled=INTEGER|-1
Name=STRING|"IMAP Mail loop"
Params=FOLDER

[Actions\Action2\Params]
from=STRING|"from"
number=STRING|"num"
subj=STRING|"subj"
usecc=STRING|"0"
usedate=STRING|"0"
useflags=STRING|"0"
usefrom=STRING|"1"
usesize=STRING|"0"
usesubj=STRING|"1"
useto=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"6"
type=STRING|"0"
value1=STRING|"POS"
value2=STRING|"{subj}"

[Actions\Action4]
ActionID=STRING|"A_IMAP_DOWNLOAD"
Enabled=INTEGER|-1
Name=STRING|"IMAP Download Message"
Params=FOLDER

[Actions\Action4\Params]
attachfolder=STRING|"{TempDir}\msg\{AddressOnly({from})}"
extract=STRING|"1"
num=STRING|"{num}"
overwrite=STRING|"0"
savefilenames=STRING|"0"
savetofile=STRING|"{TempDir}\msg\{Year}{MonthNo}{Day}{Hours}{Minutes}{Seconds}{mSeconds}.eml"

[Actions\Action5]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action6]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

This example demonstrates how to download message by criteria and save attachment into desired folder
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Re: Mail Object

Posted: Thu Jul 09, 2015 12:21 pm
by marcolobaido
Thanks, it works :) but sometimes the tasks stops because of the error: "Timeout error occurred" during the step "IMAP download message"...how can I bypass the timeout?

Re: Mail Object

Posted: Thu Jul 09, 2015 2:05 pm
by Oleg
What is the size of the message?

Re: Mail Object

Posted: Thu Jul 09, 2015 2:51 pm
by marcolobaido
there are 4 attached files:
2.5 MB
48.6 KB
1.9 MB
48.6 KB

Re: Mail Object

Posted: Thu Jul 09, 2015 3:56 pm
by marcolobaido
I deleted that mail and it seemed to be ok, but after 20 downloads the timeout error occured during the step "IMAP mail loop", not during the download...isn't it strange?

Re: Mail Object

Posted: Thu Jul 09, 2015 6:32 pm
by Oleg
We will investigate this.
Now you can try to use POP3. RoboTas has similar actions for POP3 protocol

Re: Mail Object

Posted: Fri Jul 10, 2015 9:54 am
by marcolobaido
It works perfectly with POP3 ;)