Skip to content

Instantly share code, notes, and snippets.

View RustyNails8's full-sized avatar
:electron:

Sumit Das RustyNails8

:electron:
View GitHub Profile
@RustyNails8
RustyNails8 / bash-smtp-auth-email
Created June 9, 2019 07:56 — forked from fbatschi/bash-smtp-auth-email
How to send an email from bash via SMTP Auth
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
@RustyNails8
RustyNails8 / SendMailGoLang.go
Created February 19, 2019 02:04
Send Mail with Go
package main
import (
"log"
"net/smtp"
)
var (
from = "azure@microsoft.com"
msg = []byte("TEST VM STOP")
@RustyNails8
RustyNails8 / SendMailPowerShell.ps1
Created February 19, 2019 02:02
Send Mail Powershell
<# 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)