I have a robot that data scrapes a website and saves the result in a .csv file - everything is working fine.
Now I want to add to the robot that it should send the .csv file to my email after the file is created.
I use google smtp and I can send mails via the robot, but I cant figure out how to attach the .csv file. Basically these fields:
@Peter_C you can create a new string variable FilePath, then assign the file path of your csv file. Then input the FilePath on the Value field of the Attach Files window.
I got it it send an email with the attacment by using this: Environment.CurrentDirectory+"\Rapporter\file.csv"
But my files has a DATE (“MM-dd-yyyy_hh_mm_ss”) like so: file01-09-2020_03_47_11.csv
so there anyway to attach those files. Can I make a variable that contains the file(s) - if so how?
That did not work because the files that are made by data scraping has a differend timestamp.
Maybe I can explain it this way: I want so send all csv-files in a folder but this does not work: Environment.CurrentDirectory+"\Rapporter\*.csv"
I cannot use ‘*’
My robot data scrapes and makes csv files. These files names will be named with the time+date: as shown here:
After scraping, assign DateTime.Now.ToString(“MM-dd-yyyy_hh_mm_ss”) to a String variable TimeStamp so that the time stamp will be the same as the file name of the csv file… use this later to attach the file:
Environment.CurrentDirectory+“\Rapporter\file”+ TimeStamp+“.csv”