Remove the for each loop
Drag and drop the “send mail” Activity
in To Section : email_List(1)(1).ToString
in CC Section : email_List(2)(1).ToString
Subject : email_List(3)(1).ToString
Body : email_List(4)(1).ToString
@RAKESH_KUMAR_Tiwari ,
Remove for each loop After Read range your input will be in Data Table that is “email_List” Right?
Then directly drag and drop “Send mail” Activity inside that provide
in To Section : email_List(1)(1).ToString
in CC Section : email_List(2)(1).ToString
Subject : email_List(3)(1).ToString
Body : email_List(4)(1).ToString
@RAKESH_KUMAR_Tiwari ,
You cant do like that if you want both Body and bot name together before the Send mail activity use "Create HTML Content " Activity .
Configure it Like this
but i need to attach sheet with email, which is dynamic.
it is in same excel file where i am reading the emails, but it is dynamic, so basically it has some data which i need to send as an attachment.
@RAKESH_KUMAR_Tiwari ,
Which sheet you are talking about? if the sheet is in the same excel file then you can send that excel file in the mail using attach files option.
problem is sheet is dynamic, so scenario is i am extarcting some data from website and writing it in same excel fie with sheet name(ABC), so that sheet i want to send them and delete the sheet.
so next time BOT will again scrape the data from website and store it in same excel file with sheetName (BCD) and send it in email and delete sheet. it will be in loop.
Try using copy sheet activity and copy the required sheet only to a separate excel and then attach that excel or in the loop you can always extract to samw excel name but different sheetnames so that in attachment you will give only one path always but sheets change depending on the variable
Here configure the same file name…dont change it…but in the loop create a new excel always and after sending delete and create with new sheet again using a copy sheet
For loop on the excel sheets
Copy sheet activity with copy to excel1.xlsx and sheetname would be currentitem
Sheetname