Beta 42

Research and Development


PowerShell - Sending Emails Securely (via SSL)

Here is a sample that uses the freemailer (formally called Hotmail) which does require a secure connection.

PS> Send-MailMessage -Body 'My mail message can contain special characters: äöüß' -From `
  -to -Credential -SmtpServer `
  -Subject 'Sending Mail from PowerShell' -Encoding UTF8 -UseSsl

Note that PowerShell v3 Send-MailMessage accepts UTF8 directly so you no longer need to submit the awkward ([System.Text.Encoding]::UTF8).

There are plenty of websites that list SMTP server URLs for your favorite provider: