This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <sender@mail.com>" recipient@mail.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "net/smtp" | |
| ) | |
| var ( | |
| from = "azure@microsoft.com" | |
| msg = []byte("TEST VM STOP") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# Encrypted AES Key and Password as Secure String are stored on \\myUNCpath #> | |
| $encryptedSecureKey = Get-Content \\myUNCpath\smtpKEY.txt | |
| $encryptedSecureString = Get-Content \\myUNCpath\smtprelay.txt | |
| $secureKey = ConvertTo-SecureString -String $encryptedSecureKey | |
| $secureString = ConvertTo-SecureString -String $encryptedSecureString -SecureKey $secureKey | |
| $cred = New-Object System.Management.Automation.PSCredential('Domain\User', $secureString) |
NewerOlder