Mail Object

Discuss RoboTask here
Post Reply
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Mail Object

Post 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 :)
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Mail Object

Post 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.
Oleg Yershov
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: Mail Object

Post 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?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Mail Object

Post by Oleg »

What is the size of the message?
Oleg Yershov
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: Mail Object

Post by marcolobaido »

there are 4 attached files:
2.5 MB
48.6 KB
1.9 MB
48.6 KB
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: Mail Object

Post 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?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Mail Object

Post by Oleg »

We will investigate this.
Now you can try to use POP3. RoboTas has similar actions for POP3 protocol
Oleg Yershov
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: Mail Object

Post by marcolobaido »

It works perfectly with POP3 ;)
Post Reply