| 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" |
janbc / swaks-send-mail.sh
Last active 3 months ago
Revision 9633060656cb7675bddddc5322ad4a0d2683b0c1