Skip to content

Instantly share code, notes, and snippets.

@voice1
Forked from Rhernandez513/sendEmail.sh
Created May 3, 2019 02:12
Show Gist options
  • Save voice1/6e6a4d0874089f8d5bdfe7efb03ebb7b to your computer and use it in GitHub Desktop.
Save voice1/6e6a4d0874089f8d5bdfe7efb03ebb7b 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