Skip to content
Snippets Groups Projects
Commit 95fd8056 authored by Pirate Praveen's avatar Pirate Praveen
Browse files

Script used to send mails from a csv file and template

parent bfe52c4b
Branches
No related merge requests found
while IFS=, read -r name email
do
echo "Sending mail to $name <$email>.."
cp email.template.txt email.body.txt
sed -i "s/TEMPLATE:ADDRESS/$email/" email.body.txt
sed -i "s/TEMPLATE:NAME/$name/" email.body.txt
/usr/sbin/sendmail -t < email.body.txt
rm email.body.txt
sleep 60
done < email-list.csv
# Sample email.template.txt
# From: "Your Name" <email@example.com>
# To: TEMPLATE:ADDRESS
# Subject: Your email subject
# Content-Type: text/plain; charset=utf-8
# Content-Transfer-Encoding: 8bit
#
# Dear TEMPLATE:NAME,
# Your email body
# Signature
# Sample email-list.csv
# Firstname Surname,email@example.com
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment