Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #40945

Re: send email and socket programming

From Chris Vine <chris@cvine--nospam--.freeserve.co.uk>
Newsgroups comp.lang.c++
Subject Re: send email and socket programming
Date 2016-02-15 10:04 +0000
Organization Datemas.de http://www.news.datemas.de
Message-ID <20160215100444.2c30450b@bother.homenet> (permalink)
References (6 earlier) <i_qdnflkkvu8n1zLnZ2dnUU78LednZ2d@giganews.com> <20160214230131.458a02a6@bother.homenet> <7t22cb9bsm4uc7on4fld52gi94vln1pj12@4ax.com> <20160214234322.414dc3af@bother.homenet> <vja2cbhrvrej05ca41jg8gvmn7atc2qspo@4ax.com>

Show all headers | View raw


On Sun, 14 Feb 2016 17:33:02 -0800
Geoff <geoff@invalid.invalid> wrote:
> On Sun, 14 Feb 2016 23:43:22 +0000, Chris Vine
> <chris@cvine--nospam--.freeserve.co.uk> wrote:
> 
> >On Sun, 14 Feb 2016 15:22:43 -0800
> >Geoff <geoff@invalid.invalid> wrote:  
> >> On Sun, 14 Feb 2016 23:01:31 +0000, Chris Vine
> >> <chris@cvine--nospam--.freeserve.co.uk> wrote:
> >>   
> >> >hese days its mailx, according to IEEE Std 1003.1, 2013.
> >> >However, it won't help.  First, ordinary users do not have mail
> >> >servers running on localhost, nor do they normally have sendmail
> >> >or postfix installed.    
> >> 
> >> I think you misunderstood. The mailto:: URL invokes the users
> >> default mail client, not a server. There is no local server
> >> involved and those services need not exist on the localhost, nor
> >> does the mail client communicate with a localhost socket, it
> >> communicates with the user's own mail server using his own client
> >> under his control and under his own credentials.  
> >
> >Yes, I agree that if they have that mimetype set up, that would
> >indeed work for the purpose of bringing up the mail client.
> >
> >The OP's problem is getting his text form (the order message he
> >referred to) into the client. Is there a standard means of doing
> >that? (I am not saying there isn't, but I am not sure I have seen
> >that when I have sent emails that way myself).
> >
> >Chris  
> 
> In Windows, I'd put the URL into a dialog box, such as a Help dialog
> or in an Order Something dialog opened from the Help menu item. I'd do
> it the same in OSX and the equivalent in Linux dialogs. The OP hasn't
> stated his target OS but I suspect it's Linux.
> 
> A standard way to do it? I'm not so sure. I know this works in
> Windows:
> system("start
> 
> mailto:yourname@example.com?subject=Order&body=Order%20details%20here");
> 
> I think the equivalent is 
> system("exec
> 
> mailto:yourname@example.com?subject=Order&body=Order%20details%20here");
> 
> but I haven't tested this.

OK that does seem to be the way to do it.  Excellent.  'xdg-email
--help' gives me this:

   xdg-email -- command line tool for sending mail using the
   user's preferred e-mail composer

   Synopsis

   xdg-email [--utf8] [--cc address] [--bcc address] [--subject
   text] [--body text] [--attach file] [ mailto-uri | address(es)]

So this on a unix-like system would do what he wants:

xdg-email --subject Order --body "My order is attached" \
          --attach "order-file.txt" order@supplier.net

From a cursory look at it I could not get my email client to accept
line breaks in the message body, so attaching a file might work better
for the OP.

Chris

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

send email and socket programming alexo <alelvb@inwind.it> - 2016-02-14 18:01 +0100
  Re: send email and socket programming JiiPee <no@notvalid.com> - 2016-02-14 17:07 +0000
    Re: send email and socket programming JiiPee <no@notvalid.com> - 2016-02-14 17:12 +0000
    Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-14 19:44 +0100
  Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-14 19:18 +0200
  Re: send email and socket programming Öö Tiib <ootiib@hot.ee> - 2016-02-14 09:39 -0800
    Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-14 20:23 +0100
  Re: send email and socket programming woodbrian77@gmail.com - 2016-02-14 10:47 -0800
  Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-14 21:19 +0200
    Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-14 20:29 +0100
      Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-14 22:29 +0200
        Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-14 22:45 +0100
          Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-15 00:15 +0200
            Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-15 00:39 +0200
              Re: send email and socket programming Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2016-02-14 23:01 +0000
                Re: send email and socket programming Geoff <geoff@invalid.invalid> - 2016-02-14 15:22 -0800
                Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 18:41 -0500
                Re: send email and socket programming Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2016-02-14 23:43 +0000
                Re: send email and socket programming Geoff <geoff@invalid.invalid> - 2016-02-14 17:33 -0800
                Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-15 09:37 +0200
                Re: send email and socket programming Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2016-02-15 10:04 +0000
                Re: send email and socket programming Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2016-02-15 10:14 +0000
                Re: send email and socket programming Geoff <geoff@invalid.invalid> - 2016-02-15 10:11 -0800
          Re: send email and socket programming Geoff <geoff@invalid.invalid> - 2016-02-14 15:16 -0800
  Re: send email and socket programming Ian Collins <ian-news@hotmail.com> - 2016-02-15 08:40 +1300
    Re: send email and socket programming "Chris M. Thomasson" <nospam@nospam.nospam> - 2016-02-14 12:09 -0800
  Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 16:04 -0500
  Re: send email and socket programming jt@toerring.de (Jens Thoms Toerring) - 2016-02-14 21:20 +0000
    Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-14 22:40 +0100
      Re: send email and socket programming Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2016-02-14 22:20 +0000
        Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 18:01 -0500
          Re: send email and socket programming Ian Collins <ian-news@hotmail.com> - 2016-02-15 12:09 +1300
            Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 18:37 -0500
              Re: send email and socket programming Ian Collins <ian-news@hotmail.com> - 2016-02-15 13:06 +1300
                Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 21:40 -0500
          Re: send email and socket programming Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2016-02-14 23:35 +0000
            Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 21:43 -0500
      Re: send email and socket programming Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-14 18:05 -0500
  Re: send email and socket programming Christopher Pisz <nospam@notanaddress.com> - 2016-02-16 16:39 -0600
  Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-26 04:09 +0100
    Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-26 07:49 +0200
      Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-26 08:39 +0200
        Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-26 13:15 +0100
          Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-26 14:40 +0200
            Re: send email and socket programming Christopher Pisz <nospam@notanaddress.com> - 2016-02-26 16:41 -0600
              Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-27 13:38 +0100
                Re: send email and socket programming Öö Tiib <ootiib@hot.ee> - 2016-02-27 05:15 -0800
                Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-27 18:59 +0100
                Re: send email and socket programming Öö Tiib <ootiib@hot.ee> - 2016-02-27 10:41 -0800
                Re: send email and socket programming Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-27 21:46 +0200
              Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-27 13:42 +0100
                Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-27 19:14 +0100
                Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-27 19:22 +0100
                Re: send email and socket programming guinness.tony@gmail.com - 2016-02-28 14:19 -0800
      Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-27 18:44 +0100
    Re: send email and socket programming Jorgen Grahn <grahn+nntp@snipabacken.se> - 2016-02-27 17:59 +0000
  Re: send email and socket programming alexo <alelvb@inwind.it> - 2016-02-29 14:16 +0100

csiph-web