The many varieties of spam protection mean that it’s hard to send e-mail from the command-line these days.
I thought I’d see if I couldn’t do it with wget and my squirrelmail webmail account. After much trial and error, here’s what I came up with:
wget --save-cookies cookies.txt --keep-session-cookies --post-data 'login_username=username&secretkey=password' http://webmail.server.com/src/redirect.php
wget --load-cookies cookies.txt --post-data 'body=body here&send_to=recipient%40wherever.com&subject=subject here&send=1' http://webmail.server.com/src/compose.php
Looks like options are: