extract email attachments from mail

One Star

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.
Employee

Re: extract email attachments from mail

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;
One Star

Re: extract email attachments from mail

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

Re: extract email attachments from mail

what error did you get? Does it specify anything is wrong with your connection settings?
One Star

Re: extract email attachments from mail

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!
One Star mpa
One Star

Re: extract email attachments from mail

Why not download the files just manually? This is just a 1-time download I would say..
One Star

Re: extract email attachments from mail

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.
Six Stars

Re: extract email attachments from mail

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.
One Star

Re: extract email attachments from mail

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
Moderator

Re: extract email attachments from mail

Hi Hema,
Here is a response in your another topic: http://www.talendforge.org/forum/viewtopic.php?id=39941. Could you please take a look at it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: extract email attachments from mail

Hello Sabrina,
Can you please share some examples of how tFileInputMail is used to extract attachment?
Thanks,
Hema
Moderator

Re: extract email attachments from mail

Hi,
You can set basic settings of tFileInputMail as:
Collumn           Mail part
SUBJECT          SUBJECT
ATTACHMENT   ATTACHMENT to extract email attachment.
The work flow should be:tPop --> tFileInputMail
Let us know if it is OK with you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: extract email attachments from mail

Hi,
   Can some body explain step by step procedure to extract attachment.   I need to extract email attachment monthly and put in FTP server  for reference. 
One Star

Re: extract email attachments from mail

Hi
requirement: Need to track email sent whether email is opened or not  with some other parameter data 
email Id, sent date , open date, subject line 
What is the best procedure to capture email tracking  count data.
I found something online "{img src="..."/.}" . Can I add HTML code in tsendMail component. Is there any other way to capture email tracking count ?
 
One Star

Re: extract email attachments from mail

How can I pass the email names from the Tpop component to the Tfileinputmail ??
Moderator

Re: extract email attachments from mail

Hi,
You can set  basic settings of tFileInputMail as:
Collumn           Mail part
SUBJECT          SUBJECT
                                          to read email subject in tifileinputmail.
Here is the component reference:TalendHelpCenter:tFileInputMail
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.