#!/bin/bash
ATTACH1=file.xls
SUBJECT="subject"
FROM=me@domain.com
TO=you@domain.com
CC=them@domain.com
MIME="application/xls"
FILE=$ATTACH1
boundary="---my-unlikely-text-for-mime-boundary---$$--"
(cat <
From: $FROM
To: $TO
Subject: $SUBJECT
Date: $(date +"%a, %b %e %Y %T %z")
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="$boundary"
This email has attached the file
--$boundary
Content-Type: $MIME;name="$FILE"
Content-Disposition: attachment;filename="$FILE"
!
) | sendmail -v ${TO}
No comments:
Post a Comment