Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Retrieve email from Pop and store in Database

I downloaded TalendOpenStudio 2.2.2 to evaluate if it can satisfy some of our business use cases.
I have a use case to pull emails from a pop3 server and insert them in a database table (table which has columns to store separate fields of emails such as "to email", "from email", content, header, subject etc). I found some samples which indicate that I can do this by using tPop node, which will dump the email in a file, and then I read email from file in a tFileInputMail node, which can then be connected to a tMssqlOutput node.
My use can also requires me to insert additional records in database, when an email is received (these records may not contain any data of the email received, but some other data).
However, I am a bit confused about how to map emails fields to database columns. Has anyone tried this before?
In addition to this, is there a way by which I can move email directly from tPop into one of databases, without storing the email in a file?
Any help is highly appreciated
Labels (2)
12 Replies
Anonymous
Not applicable
Author

Hi
You can use tFileInputMail component to get datas from email and store in database. Please see the screenshot.
In your database, define a table with the same fileds as the schema defined tFileInputMail.
Best regards

shong
soujanyam
Contributor
Contributor

Hi all,
I want to retrive the files which would send to mail for every 10min and store in Database. How could I do it?
Please tell me the procee flow..
tFileInpumail--->tMssqlOutput
If I use above flow Does it works?
Please anyone reply me.
Thanks in advance.
Anonymous
Not applicable
Author

Hi ms,
tPop component would download mail in the form of a file. This file is read by using tFileInputmail component having standard metadata..
https://help.talend.com/search/all?query=tFileInputMail&content-lang=en
Attachment is also stored in with the file only... you can extract file from the mail and insert into the table using a routine, which will convert your input file to text/byte code..
https://community.talend.com/t5/Design-and-Development/Inserting-BLOB-or-CLOB-data-into-a-database/t...
I hope this will help.
Thanks
Vaibhav
soujanyam
Contributor
Contributor

Thanks for your prompt reply Vaibav
Can u please tell me the flow
tPop--->tFileInpuMail--->tMssqlOutput
Does it works?
Anonymous
Not applicable
Author

tPrejob-->tDBConnection
tPop-->
OnSubjobOk--> 
tFileList-->tFileinputMail-->tJavarow(ContextVariables)
OnSubjobOk--> 
tFixedFlow-->tMSSQLOutput
Use routine to convert file into the bytecode or text contents to insert file into the database table
Vaibhav
Anonymous
Not applicable
Author

Hi 
Vaibhav has indicated that how to achieve this kind of demand, but your requirement is not clear.
Can you describe your request with more details? Do you want to extract data from the file and store the data into database or you want to store the whole file as a Blob data in database?
Best regards
Shong
soujanyam
Contributor
Contributor

Thanks for reply
What is blob i don't know?
But my requirement is, we'll get the files into mail for every 5min, the data which is there in files must be stored into Database.
soujanyam
Contributor
Contributor

Hi Vaibav,
Please could  you tell me where routine has to be run/works in above flow...
Thank you.
Anonymous
Not applicable
Author

In case if you are inserting attachment in single column, then the job of routine is to read the file contents, convert it to appropriate data type and make it available for insertion... both different methods are available in above url.
Vaibhav