Check email for subject line if match -> Print Email

Discuss RoboTask here
Post Reply
ryan
Posts: 14
Joined: Wed Aug 24, 2011 4:10 pm

Check email for subject line if match -> Print Email

Post by ryan »

I am looking to have robotask check my gmail and if the subject line contains "something is broke" to print that email on my local printer.

Any help on this would be much appreciated!!

Thanks!
ryan
Posts: 14
Joined: Wed Aug 24, 2011 4:10 pm

Re: Check email for subject line if match -> Print Email

Post by ryan »

Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Check email for subject line if match -> Print Email

Post by Oleg »

You can download necessary message to EML file and print the message body
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|444033236
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task629"
Hide=INTEGER|0
ID=INTEGER|299352747
LogOnAsUser=INTEGER|1
Name=STRING|"Print eml body"
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

[Actions\Action1]
ActionID=STRING|"A_EMAILE_PARSE"
Enabled=INTEGER|-1
Name=STRING|"Parse Email Message"
Params=FOLDER

[Actions\Action1\Params]
cc=STRING|"0"
date=STRING|"0"
extract=STRING|"0"
file=STRING|"D:\robot_spam\20120726143214975.eml"
from=STRING|"0"
overwrite=STRING|"0"
priority=STRING|"0"
savefilenames=STRING|"0"
subj=STRING|"0"
text=STRING|"1"
texttype=STRING|"0"
textvar=STRING|"txt"
to=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file D:\robot_spam\body.txt"
Params=FOLDER

[Actions\Action2\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"D:\robot_spam\body.txt"
line0=STRING|"{txt}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_PRINTDOC"
Enabled=INTEGER|-1
Name=STRING|"Print body.txt"
Params=FOLDER

[Actions\Action3\Params]
files=STRING|"D:\robot_spam\body.txt"
infinite=STRING|"0"
printer=STRING|"CutePDF Writer"
printto=STRING|"0"
timeout=STRING|"60"
wait=STRING|"0"
2-nd way
You can print whole EML file. Jist save it as TXT file and print it.
An EML file is a simple text file, but it has a special format. But you can work with it as a text file.
Oleg Yershov
Post Reply