Skip to content

Instantly share code, notes, and snippets.

@rpetrenko
Last active March 3, 2019 08:29
Show Gist options
  • Save rpetrenko/4aacef11c6949504f3390f9382c68ed6 to your computer and use it in GitHub Desktop.
Save rpetrenko/4aacef11c6949504f3390f9382c68ed6 to your computer and use it in GitHub Desktop.
send email with html attachment (in linux)
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "Arguments: <email> <subject> <fname.html>"
exit 1
fi
mail --content-type=text/html --attach="$3" --subject "$2" $1 < /dev/null
@rpetrenko
Copy link
Author

send_email.sh test@test.com "test subject" filename.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment