[AWS] Emails created - How to best enable sending using AWS?

Emmanuel Briot briot at adacore.com
Mon Nov 15 14:16:29 CET 2010


> The only solution I see is to send the e-mail yourself opening a socket and
> following the SMTP protocol. See rfc0821, rfc1521 and rfc2554 provided with
> AWS.

Or if you are on Unix, you can spawn a "sendmail" process and send the mail
rather easily.

      with GNAT.Expect; use GNAT.Expect;

      Arguments  : Argument_List_Access;
      Descriptor : Process_Descriptor;

      Arguments := new Argument_List'
        (1 => new String'("-i"), --  Line with '.' is not end of input
         2 => new String'("-f"), --  Set enveloppe sender address
         3 => new String'(Envelope_Sender),
         4 => new String'("-t")); --  Extract recipients from headers

      Non_Blocking_Spawn (Descriptor, Cmd_Sendmail.all, Arguments.all);
      Send (Descriptor, Str (Str'First .. Last), Add_LF => False);

regards,

Emmanuel


More information about the AWS mailing list