You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
660 B
Bash

#! /bin/bash
# Author : Solal "Otthorn" Nathan
#
# Petit script pour envoyer des mails avec sendmail On donne juste une
# addresse à laquelle envoyé en entrer. Le programme utilise les fichiers
# headers.txt et mail.txt comme présent dans le dossier courant comme
# configuration.
#
# Usage :
#
# ./send_html_mail.sh someone@example.org
#
# Envoie le contenu mail.txt avec les entêtes headers.txt à otthorn@crans.org
echo "Sending mail to $1"
echo "To: $1" > tmp_mail.txt
cat headers.txt >> tmp_mail.txt
echo "" >> tmp_mail.txt # the newline is very important, RFC 822
cat mail.txt >> tmp_mail.txt
/usr/sbin/sendmail -t tmp_mail.txt
#rm tmp_mail.txt