Sending email with Squirrelmail, via wget

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'

wget --load-cookies cookies.txt --post-data 'body=body here& here&send=1'

Looks like options are:

  • send_to
  • send_to_cc
  • send_to_bcc
  • body
  • subject

and maybe?:

  • replyto
  • email_address.

3 Responses to “Sending email with Squirrelmail, via wget”

  1. David Emerson Says:

    my server requires https 😉

    very useful, thanks!

  2. Paul Says:

    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.

  3. Paul Says:

    Sorry, the wget command options got parsed-up. Should be “–user=username –password=password”. Also, seem to need “–no-check-certificate”.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: