Created
June 9, 2022 11:09
-
-
Save mrbitsdcf/64e380f6bfb09b72a1fbc6dc5679d4b3 to your computer and use it in GitHub Desktop.
Test AWS SES connection
This file contains 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
#!/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