On 19 Jun 2002, Kanti Jadia wrote:
I want to send a file as attachment every few hours (using cron)
The file is a binary file and merely appending(using mail command) does not suffice.
First, add this header to the message:
Content-type: multipart/mixed; boundary="some_string_of_text" MIME-Version: 1.0
start your mail with the normal body, and then any attachments you want, encoded with mimeencode:
--some_string_of_text Content-type: text/plain
This is the body of the mail
--some_string_of_text Content-Type: application/octetstream Content-Transfer-Encoding: base64
ENCODED ATTACHMENT HERE
--some_string_of_text--
_END_OF_MAIL_
I could send you a program that does this, but I'm feeling too lazy right now.