Im still fairly new to using powershell and scripting, I have a script that grabs a file out of a folder and emails it to whoever needs it daily.
What im wondering is, Can I make a separate .txt file that has all the emails inside and it sends it to all of them?
also, how would I use the script to basically do this:
if file with name “test” created with todays date is there, send email saying successful
if file with name “test” is not there with todays date, send email saying failed.
this is what I have currently-
#Request model for daily email
$file = “E:\test.xlsx”
$smtpServer = “188.8.131.520”
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($file)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)