cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl-smtp-gmail commandline example, please?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 11 Oct 2010 19:49:26 +0200 (CEST)

On Mon, 11 Oct 2010, Sune Ahlgren wrote:

> I've been looking all over for a Linux/UNIX command line example where an
> existing gmail account is used for sending an email to wherever. My own
> attempts keep failing.

A user named 'mwnn' popped in to IRC[*] the other day with exactly this
problem and he got successful with something like this:

   curl
     --ssl
     --mail-from "<from-email-id_at_gmail.com>"
     --mail-rcpt "<to-email-id_at_gmail.com>"
     --verbose
     --url smtp://smtp.gmail.com
     -u from-email-id
     -T mailfile

... where 'mailfile' is a file that contains all the necessary headers
(Subject:, To:, From:, Date: etc) as well as the actual (pre-formatted) mail
body.

(I wrote all options on separate lines in this mail for clarity, you better
put them all on the same line.)

[*] = there are always people in the #curl channel on freenode these days!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-11