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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

extract email attachments from mail

i normally receive excel based email attachments from a predefine email. how do i extract the attachments only and store them in a folder. i can connect to the email server using talend and can download the emails. but i only want to extract the excel attachments.
Labels (2)
15 Replies
Anonymous
Not applicable
Author

Hi;
You'll see an example of a Job wich POP the email on a local location and then iterate on it to extract the Attached document (Excel files).
Then if you need to parse each Excel files, use another SubJob and tFileList on the Excel files location and iterate on the tFileInputExcel component.
Best regards;
_AnonymousUser
Specialist III
Specialist III

Hi
I was unable to even retrieve the emails Can some one please help me with this.
Thanks
Anji
Anonymous
Not applicable
Author

what error did you get? Does it specify anything is wrong with your connection settings?
Anonymous
Not applicable
Author

I am using the same logic to retrieve all attachments from my email server. I can see the emails are getting downloaded but only one attachments is getting extracted (oldest date attachment is getting extracted), and that too, the extracted file is empty!! I am connecting to gmail server and my aim is to download all attachments from emails on a local drive. I am using imap protocol with 993 port and SSL included.
I am getting below error but the emails are getting fetched too! without all attachments.
Exception in component tFileInputMail_1
java.io.IOException: Error in encoded stream: needed 4 valid base64 characters but only got 2 before EOF, the 10 most recent characters were: "AAAAPgADAP"
at com.sun.mail.util.BASE64DecoderStream.decode(BASE64DecoderStream.java:237)
at com.sun.mail.util.BASE64DecoderStream.read(BASE64DecoderStream.java:135)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at talenddemosjava.readthroughemail_0_1.ReadThroughEmail.tFileList_1Process(ReadThroughEmail.java:809)
at talenddemosjava.readthroughemail_0_1.ReadThroughEmail.tPOP_1Process(ReadThroughEmail.java:390)
at talenddemosjava.readthroughemail_0_1.ReadThroughEmail.runJobInTOS(ReadThroughEmail.java:1061)
Ignore the part text/html; charset=ISO-8859-1
Ignore the part text/html; charset=ISO-8859-1
at talenddemosjava.readthroughemail_0_1.ReadThroughEmail.main(ReadThroughEmail.java:932)

disconnected
Below are the properties of my intputFileEmail component:
filename: ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
Mail Parts: I have included 2 fields- "name" and "body"
Attachment path: correctly given
Appreciate help from anyone!
Anonymous
Not applicable
Author

Why not download the files just manually? This is just a 1-time download I would say..
_AnonymousUser
Specialist III
Specialist III

from here you can get solution to extract the attachments from emails. i am using the product to backup my attachments in emails and it works amazingly. The owner also provide free support so you can discuss your problem as well, if not resolving. take a trial.
jagadish_dasari
Contributor III
Contributor III

xanworld,
Please check the mail parts you have included.
I don't think there is any "name" in the mail part.
If you are looking for sender use "From", receiver use "Received"
Thanks,
Jagadish.
Anonymous
Not applicable
Author

Hello there, 
I am facing a similar issue. I need to connect to an outlook mail server and download email attachments on a daily basis. Does the tPop component support this?
Can you please share how you managed to extract email attachments and moved it to a local folder?
Thanks,
Hema
Anonymous
Not applicable
Author

Hi Hema,
Here is a response in your another topic: https://community.talend.com/t5/Design-and-Development/component-for-extracting-excel-or-text-attach.... Could you please take a look at it?
Best regards
Sabrina