Jump to content

Recommended Posts

Posted

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

Posted

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)

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...