Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Prompt for the -f variable for the RFC5321.MailFrom
- read -e -p "RFC5321.MailFrom address: " smtp_mailfrom
- # Prompt for the RFC5322.From field
- read -e -p "RFC5322.From address: " from_field
- # Prompt for the RCPT TO field
- read -e -p "Enter RCPT TO adress: " to_field
- # Prompt for the Subject
- read =e -p "Enter the Subject: " subject
- # Prompt for the Body (terminate with a line containing only '.')
- echo "Enter the Body (terminate with a line containing only '.'): "
- body=""
- while IFS= read -r line
- do
- if [ "$line" = "." ]; then
- break
- fi
- body="$body$line\n"
- done
- # Construct the email and send it using exim
- echo -e "From: $from_field\nTo: $to_field\nSubject: $subject\n\n$body" | exim -v -i -f "$smtp_mailfrom" -t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement