cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Sune Ahlgren <sune_ahlgren_at_hotmail.com>
Date: Mon, 11 Oct 2010 21:05:24 +0200

It still won't work. I have numbered my tries and commented them below:

1) First I made a copy (more or less) of what you suggested:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
curl
        --ssl
        --mail-from ""
        --mail-rcpt ""
        --verbose
        --url smtp://smtp.gmail.com curl
        --ssl
        --mail-from ""
        --mail-rcpt ""
        --verbose
        --url smtp://smtp.gmail.com
        -u valid_and_same_as_in_From_in_brakare.txt
        -T brakare.txt

Where the file brakare.txt looks exactly as below:
From: "a name"
 To: valid_and_same_as_in_mail-rcpt
 Date: 11 Oct 2010 20:30:30 +0100
 Subject: test

test
.
 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Enter host password for user 'someone':
* About to connect() to smtp.gmail.com port 25 (#0)
* Trying 74.125.77.109... % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0^C

2) My next try was to use port 587 (Here I only give the output I get, since the command is similiar):
Enter host password for user 'someone':
* About to connect() to smtp.gmail.com port 587 (#0)
* Trying 74.125.77.109... % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
* Connected to smtp.gmail.com (74.125.77.109) port 587 (#0)
* SMTP 0x6cab48 state change from STOP to SERVERGREET
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< 220 mx.google.com ESMTP v59sm11412922eeh.16
> EHLO brakare.txt
* SMTP 0x6cab48 state change from SERVERGREET to EHLO
< 250-mx.google.com at your service, [85.229.96.125]
< 250-SIZE 35651584
< 250-8BITMIME
< 250-STARTTLS
< 250 ENHANCEDSTATUSCODES
> STARTTLS
* SMTP 0x6cab48 state change from EHLO to STARTTLS
< 220 2.0.0 Ready to start TLS
> QUIT
* SMTP 0x6cab48 state change from STARTTLS to QUIT
  0 0 0 0 0 0 0 0 --:--:-- 0:00:13 --:--:-- 0^C

Neither of my tries above results in a mail being sent. I'm left hanging and ends the session with control-C.

Can someone please spot my mistake?

BRs
/Sune

> Date: Mon, 11 Oct 2010 19:49:26 +0200
> From: daniel_at_haxx.se
> To: curl-users_at_cool.haxx.se
> Subject: Re: curl-smtp-gmail commandline example, please?
>
> 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
                                               

-------------------------------------------------------------------
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