janbc revised this gist 4 months ago. Go to revision
No changes
janbc revised this gist 4 months ago. Go to revision
1 file changed, 21 insertions
swaks-send-mail.sh(file created)
| @@ -0,0 +1,21 @@ | |||
| 1 | + | unset HISTFILE | |
| 2 | + | ||
| 3 | + | SMTP_USR="usernamegoeshere" | |
| 4 | + | SMTP_PWD="******" | |
| 5 | + | ||
| 6 | + | MAIL_DATA="Subject: Hello from swaks\n\nThis is the body." | |
| 7 | + | ||
| 8 | + | MAIL_FROM=$1 | |
| 9 | + | MAIL_TO=$2 | |
| 10 | + | ||
| 11 | + | swaks --to $MAIL_TO \ | |
| 12 | + | --from $MAIL_FROM \ | |
| 13 | + | --header "From: $MAIL_FROM" \ | |
| 14 | + | --header "To: $MAIL_TO" \ | |
| 15 | + | --server smtp.tanhub.net \ | |
| 16 | + | --port 465 \ | |
| 17 | + | --tls \ | |
| 18 | + | --auth LOGIN \ | |
| 19 | + | --auth-user $SMTP_USR \ | |
| 20 | + | --auth-password $SMTP_PWD \ | |
| 21 | + | --data "$MAIL_DATA" | |
Newer
Older