Email Automation

DGUPTA9

New Member
Hi Team,

I want to fetch a mail specific to a subject and want to save the attachment of that mail only using automation anywhere.Kindly provide your suggestions to do the same.

I have done get all messages and save attachments. But it is saving the attachment of all the mails.
 

VJR

Well-Known Member
Hi DGUPTA9,

Inside the loop where you are reading emails, add an 'If' statement.
Using the System Variables from the Variable Manager, select the $Email Subject$ variable and add your subject accordingly.

Something like this:
Start Loop
If $Email Subject$ ="My required Subject Here" then


End if
End Loop
 

DGUPTA9

New Member
Hi VJ,

I have already done this previously and it is working fine but it is saving the attachments of all the mails.
I need to save the attachment of that particular mail only which I am fetching via subject.
 

VJR

Well-Known Member
Yes you are right, when multiple emails are read and the If condition is used for an email only with a specific subject it downloads the attachments of all emails.
I am not seeing any way direct to retrieve the desired attachment. Perhaps the only way now remains is to allow the downloads and delete the unwanted ones when the Task is complete.
 

DGUPTA9

New Member
Hi VJ,

Since allow the downloads will keep all the downloads from the mails so the problem remains the same here. Correct me if I am wrong.

Also, I have one more question related to mail automation i.e. :- I want to move email from one folder to another in outlook using automation anywhere. Could you please help me in knowing if we have any activity for mail movement or how can we do it.
 

VJR

Well-Known Member
Hi DGUPTA9,

I was actually referring to allow all the attachments to be downloaded and then using another command to delete the unwanted attachments and keeping the wanted ones if you are aware of a specific pattern in their file names.

Regarding moving of emails, I haven't done it before nor I have Outlook on the machine with AA so cannot take a look.
What I can think of is - there are lots of vbscripts on the web that accesses the email folders and moves them to another just by giving its name. Probably you can use that script and call the vbs file from AA.
 
Top