GOAL: Get a text file on my file server into my gmail inbox.
The file server is running Ubuntu Server 8.04 I currently SSH into it from time to time and to check logs, SMART stats for hard drives, and such. I'm looking into setting up a scheduled script that runs some commands and sends me the output via email.
The only issue I'm having is with actually getting the email sent. I have no experience with email config under linux and all guides pointing to sendmail seem to assume lots of things on behalf of myself and my current config. The servers are set up for file sharing with samba and NOT as mail, web, or dns servers. I don't want to run a mail server or route anything from the server or receive any mail on (or with) the server, unless any of that helps me accomplish the goal. The file server is on our normal network and has internet access.
I own several website domains (and have a hosting package). I've been able to set up apps like thunderbird to send mail using one of the accounts from my website by filling in smtp.mydotcom.com for the outgoing server to use and changing ports etc to match the information from my website's cpanel config page. Is there a way to do something similar so I can send an email from my file server to my external email?
EDIT: Here are the steps I took after reading Dennis Williamson's answer below. I was up and running in only a few minutes!
sudo apt-get install esmtp
I created a new email account on my website (called "alerts") and edited /etc/esmtprc like this:
(These values were provided by the cpanel admin page)
Then I created a file called "eheader" with the default top of email:
To: Me <firstname.lastname@example.org>
From: Alerts <email@example.com>
So, in order to fire off the mail the following command can be used:
cat eheader <file1> <file2> ... <fileN> | /usr/bin/esmtp -t
So it's easy to vary which files are sent for the daily/weekly/etc jobs.