Can someone send a sample .xaml file for downloading attachments from a specific mail in outlook. Appreciate the help.
Thanks
- Use Get Outlook MailMessage Activity to read mails from outlook. If you want to read specific mails then pass subject into filter option like below and will give output as List of Mail Messages and name it as mailMessage
"[Subject] = âSubject of the Mailâ "
- Then use For Each loop to itreate that list of mails.
ForEach item in mailMessage
- use Save Attachments Activity to
save the attachments
Hi buddy
@Juni2799
Fine
Kindly follow the below steps that could help you resolve this
âuse any get outlook mail Activity, but make sure that your system is configures with outlook or we can use get exchange mail activity and here we need to mention the user credentials and server name as well
âin the filter property, we can specify the criteria to be specified like what to be obtained from the inbox⌠like this
"[Subject] = âthe mail subject you want to search forâ "
âthe output of this get outlook mail will be of type collection of mailmessages and lets name it out_mailmessage
âNow use a for each loop and pass the above as input and make sure that the tyoe argument property in the for each loop is changed to mailmessage
âinside this loop use a Activity called Save attachement, inside which pass the input with mail input as item, the Variable that we obtain from for each loop and in file path mention the path where you want to save the file with file name you want to save with
Thats all buddy you are done
Kindly try this and let know for any queries or clarification
Cheers @Juni2799
What is the filter for Senderâs address and what do you mean by configure the system with outlook??
Also, thanks for the prompt replies
vMailMessageVariable.From.ToString will give you the senders name where vMailMessage variable is the mail object
Hi @chdas, thanks for the reply but can you please give a step by step how-to for itâŚThanks
Fine i meant this like your system is installed with outlook or notâŚif make sure to install outlook if we are using get outlook mail activity, as unless we have that installed we cannot perform this activity
Then for Senderâs Address filter
we can handle this two methods
- First we need to use like this filter property in get outlook mail activity
"[From]=âAbisha Gopalanâ â
(not the mail id with domain details, just name)
But if we want to filter gmail mail address from my outlook, we need to mention like this
"[SenderEmailAddress]=,abisha****@gmail.comâ "**
or
- If we dont know the name part to be mentioned in Filter property of get outlook mail
avoid mentioning the filter and we can make some filter once after getting the mail list from the get outlook mail activity with a if condition like this
âget the output from get outlook mail activity with a variable of type mail messages collection named out_mailmessage
âuse a for each loop and pass the above variable as input and change the type argument as mailmessage in for each loop property
âinside the for each loop use a if condition to validate with sender name
like this
item.From.Tostring.Equals(âYour personâs mail idâ)
Hope this would help you
Kindly try and let know for any queries,
and make a tag with @ followed by name as then only we will be getting the notification
Cheers @Juni2799
Check the below workflow to get the sender and follow the steps
-
Properties for Get outlook mail messeges
MailFolder = âInboxâ
Account = (Outlook should be installed in the machine)
You have options to choose between read and unread emails
Output - Provide a variable Say vEmailMessages -
For Each Activity
TypeArgument = System.Net.Mail.MailMessage
Values = vMailMessages
Inside For Each put a log with vMailMessages.From.ToString.
Cheers
Hi @Palaniyappan I used the 2nd method you wrote and in the If condition I used the save attachments activity but it doesnât download the attachments nor does it make the folder with the name provided. Thanks for the reply
Can i have a view on the workflow a screenshot if possible
Cheers @Juni2799
usually mail id wont have space inbetween like this
is the mentioned string is correct
if we are not sure with the full email id, we can mention a part of it with this condition
item.From.Tostring.Contains(âa word from the mail idâ)
Cheers @Juni2799
No, Hidden Email in the sense I didnât want to show the email ID of the person thatâs why I wrote like that. Otherwise I write like this -
abc@gmail.com
so is that variableâŚ!
if so remove the double quotes around and just mention like item.From.ToString.Equals(Hidden Email)
Cheers @Juni2799
Itâs not a variable, the actual email ID is confidential content thatâs why I have written âHidden Emailâ so that the email doesnât show on the screenshot. I have understood what you told me but Iâm trying to say that itâs not working nor is it showing any errors.
Also the attachments are not been downloaded, it just executes and closes without downloading the attachments.
what does this means,
is it a mail id or what,OR
does this string comes inside the mail id,
see this item.From.Tostring.Contains(âa word from the mail idâ) will usually check whether the mailid has the word that is mentioned within the double quotes
Cheers @Juni2799