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=-0.9 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!mRBVMlGoFUnDsRgMYRJiSw.user.46.165.242.75.POSTED!not-for-mail From: Richard Iswara Newsgroups: comp.lang.ada Subject: Re: Attempt to send email using AWS results in Socket closed by peer Date: Thu, 2 Sep 2021 10:29:32 +0700 Organization: Aioe.org NNTP Server Message-ID: References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="57875"; posting-host="mRBVMlGoFUnDsRgMYRJiSw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62602 List-Id: On 02/09/2021 01.58, Juan Rayas wrote: > Hi, > > I am teaching myself Ada and tried to create a simple program that sends an email if today's date equals my birthday :). > > I am using Gnat Studio 2021, Community edition, Ubuntu 20.0.4. I downloaded, built and installed AWS. I am sending the email as follows: > > procedure SendMail is > Status : AWS.SMTP.Status; > Auth : aliased constant SMTP.Authentication.Plain.Credential := > SMTP.Authentication.Plain.Initialize > ("myAccount", "myPassword"); > Isp : SMTP.Receiver; > > begin > New_Line; > Isp := > SMTP.Client.Initialize > ("smtp.gmail.com", Port => 465, > Credential => Auth'Unchecked_Access); > > SMTP.Client.Send > (Isp, From => SMTP.E_Mail ("Me", "myAccount"), > To => SMTP.E_Mail ("Me", "myAccount"), > Subject => "AWS test", > Message => "This is a test", > Status => Status); > > if not SMTP.Is_Ok (Status) then > Text_IO.Put_Line > ("Can't send message :" & SMTP.Status_Message (Status)); > end if; > end SendMail; > > myAccount and myPassword are removed for the purposes of this post. > > When I run my program, the SendEmail procedure fails with the following message: > > raised AWS.SMTP.SERVER_ERROR : raised AWS.NET.SOCKET_ERROR : Receive : Socket closed by peer > > Does anyone know how to fix this when using the gmail server? Or perhaps I am using AWS incorrectly? > > Thanks, > Juan > Use a public email test server for testing program. Places like these: https://www.bing.com/search?form=MOZLBR&pc=MOZI&q=email+test+servers. It will show what's the received and sent responses. The Gmail server marked your message as spam or worse and simply ignored your message.