You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hi.
I need to download and rename mail attachments.
I'm daily receiving an email whose subjects contain the date while the attachment name is always the same.
I need to save the attachment and RENAME it with the mail subject.
Please help.
Many thanks, in advance,
Andrea
Offline

Hi Pedro.
Thanks for your answer ....
Just a couple of questions:
1) using the tInputMail I've the problem that it overwrites the attachments file if I'm gettingm ore than one un-read email ...
a possibile workaround is to extract only one email anceh then using a LOOP to downaload all the emails...any other ideas ?
2) using the tFileCopy, how can I pass to it the email subject to compose the new attachment name ? (sorry but I'm very new using Talend)
Thanks,
Andrea
Offline

Hi Andrea
1)
You can set "Attachment export directory" of tFileInputMail like this to avoid overwriting.
"E:/Attachment/"+context.sequence+"/" //context.sequence will be increased by tJava(context.sequence++)
Export each attachment into an unique directory.
2) You can set "Mail parts" of tFileInputMail as follows. Then extract this field into a variable.
Column Mail part Object "Subject"
Regards,
Pedro
Offline

1) You can set "Attachment export directory" of tFileInputMail like this to avoid overwriting.
"E:/Attachment/"+context.sequence+"/" //context.sequence will be increased by tJava(context.sequence++)
Ok, I'm going to try this ... but I'll nedd a way to give the exact name (related to the subject) to the proper directory attachment ...
2) You can set "Mail parts" of tFileInputMail as follows. Then extract this field into a variable.
Column Mail part Object "Subject"
I did it .. I'm writing a csv file with the sender and subject of the downloaded emails ...
My problem is to pass the subject to che tCOPY.
Thanks,
Andrea
Offline
Hi, can you please explain exactly, how I can detach the attachments with tInputMail?
The original filename is in my case in the subject ...
Offline
Pages: 1