how e-mail sending mechanisms in Linux work, you can install the SendEmail script from:
or install it from the distro repositories:
from the command line:
$ sudo aptitude install sendemail
fill in the name / message (from file is OK) / SMTP server (TLS is OK)... and you're up and running.
Detailed instructions can be found at the URL or via the man(ual) file.
$ man sendemail
Good luck. Versions are also available for Winblows (98-XP, probably untested on Vista/W7) and OSX. A careful examination of the Linux script might tell you quite a lot about how e-mail sending works.