Looping emails and attachments

hari

New Member
I am using RPA - Blueprism - Email- POP3/SMTP VBO.

I have a folder which contains 'a','b','c' files. I have to send 'a' file to 'a@email.com', 'b' file to 'b@email.com' and similarly for 'c'.

I added a loop for email ID's . I am able to send to email to every one. Now i am having issue to sending only one attachment. Attachment is accepting only collection. When i created a collection for attachments it's sending all files. Any help would be appreciated.
 

VJR

Well-Known Member
Hi hari,

You will need to dynamically add the path to the collection depending on whom you are sending the email to.
If you already know which attachment is to be sent to which email Id then you can hard code it.
If not, then you need to find a unique pattern for co-relating between the file and the email address.

- You can use a Choice stage (or Decision stage if there are very less email Ids to be processed).
- Read the email Id.
- Add an empty row to the Attachments collection using 'Add Row' of Collection VBO (not Utility Collection).
- Then Use a Calc stage to insert the path into the Attachments collection. (this is the place where you need to set which attachment needs to go to which email Id as explained above).
- Once email is sent remove all rows so that next time in your loop the Attachments collection will start fresh for a new attachment to the new email Id. Use 'Remove All Rows' of Collection VBO (not Utility Collection).

Post back if you are facing any issues.
 
Top