Skip to content

Instantly share code, notes, and snippets.

@mrbitsdcf
Created June 9, 2022 11:09
Show Gist options
  • Save mrbitsdcf/64e380f6bfb09b72a1fbc6dc5679d4b3 to your computer and use it in GitHub Desktop.
Save mrbitsdcf/64e380f6bfb09b72a1fbc6dc5679d4b3 to your computer and use it in GitHub Desktop.
Test AWS SES connection
#!/bin/bash
USER=$(echo -n $1 | base64)
PASS=$(echo -n $2 | base64)
# Connect to AWS SES
openssl s_client -crlf -quiet -connect email-smtp.us-east-1.amazonaws.com:465
openssl s_client -crlf -quiet -starttls smtp -connect email-smtp.us-east-1.amazonaws.com:25
# SMTP commands
EHLO example.com
AUTH LOGIN
# Username by 'echo -n [accesskey] | base64'
$USER
# Password by 'echo -n [secretkey] | base64'
$PASS
# SMTP Commands
MAIL FROM:[verifiedemail]
RCPT TO:[verifiedemail]
DATA
Subject: Testing the SES
This was a test
.
QUIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment