Downloade email attachment

Hi I’m try to download email attachments. I have created a work flow but i’m getting below error message for variable declaration error can any one please help me

@vivek_sivam

Welcome to the uipath community.

We could not see any error information in the above post. Could you please tell more details about the issue and so that we can check and help you.

@lakshman Thanks you
![image|364x7image

1 Like

Hi
welcome to upiath community

Change the type argument in for each loop as system.net.mail.mailmesage in the property panel and try once

hope these steps would help you resolve this
–use get outlook mail activity and get the output with a variable named list_mailmessge
–then pass the variable as input to FOR EACH activity and change the type argument as mentioned above
–inside the loop use SAVE ATTACHMENT activity and mention the mail input as item and mention the folder path where we want to save the file

Cheers @vivek_sivam

2 Likes

@vivek_sivam

As @Palaniyappan mentioned, change the Type Argument and then give it a try.

1 Like

@Palaniyappan Thanks


These are all the type of argument. I have selected system.net.mail.mailmesage only but still i’m getting the error message

did these steps helped you resolve this

Cheers @vivek_sivam

@Palaniyappan I have sort out the mail message issues. But i’m getting another two errors.
I have attached my work flow
1.Can’t have both IsPassword and Options properties set.It’s from mail(Mail)
2.One or more children have validation error or warning-- It’s from (In put dialog)
Ui%20path3

Fine
can you get the cursor to that blue mark in INPUT DIALOG BOX activity so that we can look on to the issue
Cheers @vivek_sivam

@Palaniyappan
I have fixed the above two errors.
When i try to execute i’m getting below error message. Can you please help me
I have use the same credentials to login using browser.
Do i need to change any setting in Gmail?

ERROR MESSAGE
image

yah
kindly have a view onthis

Cheers @vivek_sivam

@Palaniyappan
I have enable the two option. Please find the attached screen shot.
Still i’m getting the same error
Can you please guide meUi%20path5

@Palaniyappan
I have sort out my all the problem. It’s working fine.
Right now my work flow as follow
1.Run the work flow
2.It ask password then press Ok
3.Flow completed.
------Output-------
Download all the attachments from Gmail(Only from the inbox unread messages) to save in local machine
But i want to use multiple gmails is this possible?
Can you help me on this
Thanks

hope these steps would help you resolve this
–use get IMAP mail activity and get the output with a variable named list_mailmessge
–then pass the variable as input to FOR EACH activity and change the type argument as mentioned above like system.net.mail.mailmesage and enable ONLYUNREADMESSAGE property

–inside the loop use SAVE ATTACHMENT activity and mention the mail input as item and mention the folder path where we want to save the file

Cheers @vivek_sivam
Cheers @vivek_sivam

@Palaniyappan
How to we download multiple gmail users attachment in single run
like
i’m having many gmail accounts
I want to download all the attachments for all the users
Thanks

you mean username mentioned in imap activity
@vivek_sivam

@Palaniyappan
Yes, in my current work flow i have mentioned only one email address and i didn’t enter the password. at the time of run my work flow it will ask the password.
I want to download multi Gmail attachments. Like i’m having 10 to 15 gmail address and it have the different passwords . In single work flow how to download
Thanks

great
hope these steps would help you resolve this
–use a list variable named list_username in the variable panel of type system.collections.generic.list(of string) with default value as new list(of string) from {“username1”,“username2”,“username3”,“username4”}
–now use a for each activity and pass the above variable list_username as input and change the type argument as strin
–inside the loop use INPUT DIALOG BOX activity and mention in the label like this
"Enter the password for this user: "+item.ToString
–get the output with a variable of type string named str_password
–now use a GET IMAP MAIL Activityy and mention all the properties as same as now and change the password property with this variable str_password
– then pass the variable as input to FOR EACH activity and change the type argument as mentioned above like system.net.mail.mailmesage and enable ONLYUNREADMESSAGE property
–inside the loop use SAVE ATTACHMENT activity and mention the mail input as item and mention the folder path where we want to save the file

this will get the input password for all user and get their mail attachments
kindly try this and let know for any queries or clarification

Cheers @vivek_sivam

Hi @Palaniyappan
Will check and let you know.
I need one more help can we write a work flow like
1.Open the browser
2.Enter the URL
3.Enter the user cradentials
4.Go to download option (from the site have this option)
5.Download the attachment

Fine
–use open browser activity And mention the url we want
—now use a type into activity and enter the user name and one more type into activity for password
—then use click activity option to go for the download button or try with click image activity
—then we will be able to download the file

Cheers @vivek_sivam