An open API service indexing awesome lists of open source software.

https://github.com/gcclinux/powershellmail

Example how to send email using PowerShell
https://github.com/gcclinux/powershellmail

Last synced: 12 months ago
JSON representation

Example how to send email using PowerShell

Awesome Lists containing this project

README

          

# PowerShellMail
Example how to send email using PowerShell





# Update variable first.

$password = "password_here"

$username = "user_name"

$FROM = 'sender@gmail.com'

$TO = 'receiver@gmail.com'

$SUBJECT = 'Subject Test in PowerShell'

$MESSAGE = 'This is the entire message content that will be sent via powershell'



# executing script with above settings.

$secpasswd = ConvertTo-SecureString $password -AsPlainText -Force

$cred = New-Object System.Management.Automation.PSCredential ($username, $secpasswd)

Send-MailMessage -SmtpServer smtp.gmail.com -Credential $cred -UseSsl -From $FROM -To $TO -Subject $SUBJECT -Body $MESSAGE