Downloading email attachment issue

Hi, I am unable to download the email attachment. Kindly help.
@Lahiru.Fernando @lakshman

1 Like

Hi
Fine
May I know which activity you were using
Cheers @balkishan

1 Like

Hi Palani thanks for the quick response bro.

I am using the Save Attachment. But here I am using the while loop bro. Bcz I am reading the first oldest email. So I am not using the For Each Loop here.

Fine
Can I have a view on the save attachment activity with a screenshot if possible
@balkishan

1 Like

Sure bro.

Bro It executed fine, but not saving the attachment.
image

My Folder is
image

see here bro…It will execute fine but saving the attachment, Even this email contain one attachment.
image

@balkishan

Is this folder inside project folder ?

1 Like

Yes bro…

But it save only when we gave the full folder path. But the folder is inside the project only.

@balkishan

Are you getting any error ?

Could you tell me the steps you followed here ?

1 Like

Fine check with these stuffs pls
—is “Attachments” folder is created in your project folder and if not kindly create it
—then we need to check ether the mailmessage list is first fetched
And to validate that use a write line activity before the while loop and mention as MailMessage.count.ToString which will give us count
—and even though if it gives us the mail message count more than zero we need to check whether there is any attachment in those mails
—for that we need to validate like Mailmessage(N).Attachments.Any.ToString within a write line activity before to the save attachment activity which will give us a Boolean output either as true or false and even better place it in a IF condition with condition like this
** Mailmessage(N).Attachments.Any**
If true it will get into THEN part where we can keep our Save attachment activity

Kindly try these and let know for any queries or clarification
Cheers @balkishan

2 Likes

Remove .ToString and mention like this
Mailmessage(N).Attachments.Any

Cheers @balkishan

1 Like

my bad showing error bcz of . after any

Thanks a lot it’s worked bro.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.