Skip to content

Instantly share code, notes, and snippets.

@Rhernandez513
Last active August 12, 2023 19:31
Show Gist options
  • Save Rhernandez513/bda3837256f6e7f208766a1da25407dc to your computer and use it in GitHub Desktop.
Save Rhernandez513/bda3837256f6e7f208766a1da25407dc to your computer and use it in GitHub Desktop.
Simple script to send emails with mailgun api
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -o allexport
source .env
set +o allexport
curl -s --user "$MAILGUN_API_KEY" \
https://api.mailgun.net/v3/"$MAILGUN_DOMAIN"/messages \
-F from="$SENDER" \
-F to="$RECEPIENT" \
-F subject="$SUBJECT" \
-F text="$TEXT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment