I use sendmail:
Code:
echo "message body" | sendmail -f sender@mail.com -s "the subject" recipient@mail.com
'-t' instructs sendmail to inspect the message body for recipients, not specify a recipient. This puts a recipient in the envelope, not the header, something to which many SMTP servers object. If you use -t you can put the recipients in the body:
Code:
echo -e "to: recipient@mail.com\ncc: carbon@mail.com\nbcc: blindcarbon@mail.com\n\nmessage body" | sendmail -t -f sender@mail.com -s "the subject"