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:
- send_to
- send_to_cc
- send_to_bcc
- body
- subject
and maybe?:
- replyto
- email_address.
December 1, 2007 at 11:42 pm |
my server requires https
very useful, thanks!
August 11, 2012 at 8:38 pm |
Can’t get this working with https. Tried adding “–user= \\password=”. I get no errors, but nothing ever shows up in the destination mailbox, nor does anything show up in the SM “sent” folder.
August 11, 2012 at 8:41 pm |
Sorry, the wget command options got parsed-up. Should be “–user=username –password=password”. Also, seem to need “–no-check-certificate”.