- this being done on a mac with available commands.
- this example is using mailgun and AUTH LOGIN method. may need to be adjusted for different providers.
echo -n username@example.com|base64
echo -n password|base64Note
some login methods may require combining these strings with null character /0. in these cases may need to use printf instead of echo in cases where username or password starts with a digit and follows /0.
Note
troubleshooting the generated string: printf yourBase64hash|base64 -d | od -c
starting session smtp session:
openssl s_client -connect smtp.mailgun.org:587 -starttls smtpYou should see something similar to this:
CONNECTED(00000005)
...truncated for brevity, lots of certificate / connection info may display and eventually you see
---
250 STARTTLSissue command:
auth loginyou should see a prompt similar to this: (the string is the base64 encoded prompt Username:
334 VXNlcm5hbWU6paste in the base64 encoded username from earlier and hit enter.
next you should see a prompt similar to this (the string is the base64 encoded prompt Password:
334 UGFzc3dvcmQ6paste in the base64 encoded password from earlier and hit enter.
you should get 235 Authentication successful
now send mail by issuing mail commands.
mail from:username@example.com
250 Sender address accepted
rcpt to:testrecipient@another.example.com
250 Recipient address accepted
data
354 Continue
subject:hello test
this is a hello test email
.
250 Great success
quit
221 See you later. Yours truly, Mailgun
closed