From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Doctor Who Newsgroups: comp.lang.ada Subject: Re: Attempt to send email using AWS results in Socket closed by peer Date: Fri, 03 Sep 2021 21:33:15 +0200 Organization: A noiseless patient Spider Message-ID: References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com> <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com> <1194b579-9dc3-4e2e-b6ac-48755a7b2f10n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: reader02.eternal-september.org; posting-host="eeb2cdb77a5db2d9d4ea4d851d19a53a"; logging-data="8724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196XaVaDYlm/EWw2xLaKYKA" User-Agent: ForteAgent/8.00.32.1272 Cancel-Lock: sha1:DSprS4CTHK16q9aFq6B5HPp6fl8= Xref: reader02.eternal-september.org comp.lang.ada:62622 List-Id: On Fri, 3 Sep 2021 11:11:41 -0700 (PDT), Juan Rayas wrote: >On Friday, September 3, 2021 at 1:59:33 AM UTC-7, Doctor Who wrote: >> On Fri, 3 Sep 2021 09:32:27 +0200, "Dmitry A. Kazakov" >> wrote: >> >> >On 2021-09-03 00:19, Randy Brukardt wrote: >> >> "Dmitry A. Kazakov" wrote in message >> >> news:sgol48$r20$1...@gioia.aioe.org... >> >> ... >> >>> Most mail servers do not accept unencrypted connections. >> >> >> >> That's news to me, as my mail server (you know, the one that runs >> >> Ada-Comment and the other ARG lists) doesn't support encrypted connections. >> >> I don't have any problem sending to GMail (I send copies of most of my >> >> personal mail there). Something else must be wrong. >> > >> >The question is with what settings. There are hundreds of combinations >> >of Port x unencrypted|StartTLS|TLS x authentication method. >> > >> >The port 465 was intended for TLS, then it was depreciated. Then they >> >introduced other ports. Legacy mail servers pissed that all on etc. >> > >> > From experience, getting a SMTP client working is real pain. >> he is better off using his own provider's mail server on port 25, it >> will accept username/password as authentication. >Hi all, > > thank you for your comments and responses. > >I tried changing the port number to 25, using the default port number in the SMTP.Client.Initialize procedure, and using other port numbers such as 587. I even tried just initializing the SMT server and sending the email (without authentication) as indicated in https://docs.adacore.com/aws-docs/aws/working_with_mails.html. > >In all cases, I get the following error: > >Can't send message :530 5.7.0 Must issue a STARTTLS command first. u7sm5705829pju.13 - gsmtp > >The problem is I don't know how to send the STARTTLS command with AWS. Anyone know how? > >My past experience was mostly with real-time embedded systems, so I don't have a lot of experience with email servers. I didn't expect this to be so difficult. Since this was mostly a toy to learn Ada, I may move on to other aspects of Ada for now. > >Thanks for all your comments. >--Juan you have to change mail server: Isp := SMTP.Client.Initialize ("smtp.gmail.com", Port => 465, Credential => Auth'Unchecked_Access); don't use gmail, use your provider mail server ...