From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: send email Date: Tue, 18 Jul 2017 09:48:26 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 18 Jul 2017 07:44:30 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="66f261e4023489667345028b2d377eac"; logging-data="3984"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TIGmXb2LI6APh88l4T2qh" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 In-Reply-To: Cancel-Lock: sha1:mPfKAKD/ybNH1p0/DQ0S/Fuzd/Y= Xref: news.eternal-september.org comp.lang.ada:47445 Date: 2017-07-18T09:48:26+02:00 List-Id: On 2017-06-28 11:25, Distant Worlds wrote: > > > /********************************************************************/ > > raised PROGRAM_ERROR : finalize/adjust raised exception > > /********************************************************************/ > > CentOS 6.9 Ada GNAT 2017 > > >>> :(( > > I got this running fine seding mails from Amazon. I _think_ you need a Credential parameter in the Initialize if you say Secure => True And I could not point out the path to the cert, had to make that current directory. But that may have changed now. procedure Mail_Saldo(Saldo, Old : Balances.Balance_Type) is T : Calendar2.Time_Type := Calendar2.Clock; Subject : constant String := "BetBot Saldo Report"; use AWS; SMTP_Server_Name : constant String := "email-smtp.eu-west-1.amazonaws.com"; Status : SMTP.Status; begin Ada.Directories.Set_Directory(Ada.Environment_Variables.Value("BOT_CONFIG") & "/sslcert"); declare Auth : aliased constant SMTP.Authentication.Plain.Credential := SMTP.Authentication.Plain.Initialize ("AKESJZDQQ2DDNB58SKQ", "SOME scrabled string"); SMTP_Server : SMTP.Receiver := SMTP.Client.Initialize (SMTP_Server_Name, Port => 2465, Secure => True, Credential => Auth'Unchecked_Access); use Ada.Characters.Latin_1; Today : Fixed_Type := Saldo.Balance + abs(Saldo.Exposure); Yesterday : Fixed_Type := Old.Balance + abs(Old.Exposure); Msg : constant String := "some MSG sent from: " & GNAT.Sockets.Host_Name ; Receivers : constant SMTP.Recipients := ( An array of the receivers ); begin SMTP.Client.Send(Server => SMTP_Server, From => SMTP.E_Mail ("someone", "someone@someone.com"), To => Receivers, Subject => Subject, Message => Msg, Status => Status); end; if not SMTP.Is_Ok (Status) then Log (Me & "Mail_Saldo", "Can't send message: " & SMTP.Status_Message (Status)); end if; end Mail_Saldo; -- -- Björn