reggiep Posted May 3, 2013 Posted May 3, 2013 A suggestion that has been made to me is to send out a form weekly to staff asking them if they have any IT requests for the week such as booking a photographer for an event, a projector in the gym, microphones in the hall etc. As I am inherently lazy I don't want to have to get in every Monday and send the email, I want to automate this instead BUT I don't think outlook will do this without an add on. Can anyone suggest how I can automate this? Thanks
pcstru Posted May 3, 2013 Posted May 3, 2013 Use a scheduled task to trigger a powershell script. example script. 1
reggiep Posted May 3, 2013 Author Posted May 3, 2013 Use a scheduled task to trigger a powershell script. example script. Thanks, that works a treat. I just don't use powershell enough!
Arthur Posted May 7, 2013 Posted May 7, 2013 Also worth mentioning is that if your SMTP server requires authentication and TLS (e.g. Gmail) you will need to use a slightly different Powershell script. $emailSmtpServer = "smtp.gmail.com" $emailSmtpServerPort = "587" $emailSmtpUser = "[email protected]" $emailSmtpPass = "password" $emailFrom = "Reggie " $emailTo = "[email protected]" $emailMessage = New-Object System.Net.Mail.MailMessage($emailFrom, $emailTo) $emailMessage.Subject = "Test e-mail" $emailMessage.IsBodyHtml = $true $emailMessage.Body = @" This message is HTML formatted. "@ $SMTPClient = New-Object System.Net.Mail.SmtpClient($emailSmtpServer, $emailSmtpServerPort) $SMTPClient.EnableSSL = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential($emailSmtpUser, $emailSmtpPass); $SMTPClient.Send($emailMessage) 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now