<# They should be sent out on Fridays at 430p – #> # Creating .NET Objects $msg = new-object Net.Mail.MailMessage # Setting up the email parameters. $msg.From=("hr-notifications@hchent.com") $msg.To.Add("HCHEmFull@hchent.com") #$msg.To.Add("bhunter@hchent.com") $efiles=Get-Content -Path C:\Users\bhunter\bin\ExternalEmails.txt foreach ($efile in $efiles) { #Write-Host "ADDRESS: $efile" $msg.Bcc.Add("$efile") } #$msg.Cc.Add("jlevesque@hchent.com") #$msg.Cc.Add("lariza@hchent.com") $msg.Subject = "Time-Sheets End of the Week Reminder" $msg.Body = "Happy Friday, `nI hope you are all doing well! Quickbooks Intuit’s Timesheets are due no later than Sunday night! `nOn the other hand, for those who must enter DotStaff and/or Dayforce Timesheets should submit them by end of the day today! `nIf you have any questions or need timesheet assistance do not hesitate to reach out to me Lisa Choummalaithong at lchoum@hchent.com `nKindest Regards, Lisa Choummalaithong HR Support Analyst 3016 Post Road, Warwick, RI 02886 Office: (401) 568-5778 x3779 Cell: (401) 952-1731 " $smtpServer = "smtp.office365.com" $smtp = new-object Net.Mail.SmtpClient($smtpServer,"25") $smtp.EnableSsl = $true; $smtp.Credentials = New-Object System.Net.NetworkCredential("itsec@hchent.com", "HCHS3cOps2030!"); $smtp.Send($msg) Start-Sleep 2 Remove-Variable msg Remove-Variable smtp Remove-Variable smtpServer Exit(0)