Skip to content

Instantly share code, notes, and snippets.

Created November 13, 2016 22:39
Show Gist options
  • Save anonymous/a90387507842aded420402d4fce33076 to your computer and use it in GitHub Desktop.
Save anonymous/a90387507842aded420402d4fce33076 to your computer and use it in GitHub Desktop.
with Ada.Text_IO;
with AWS.SMTP;
with AWS.SMTP.Client;
procedure Text_Email is
Sample_Mail : String := "Hello there!";
SMTP_Server : AWS.SMTP.Receiver := AWS.SMTP.Client.Initialize("localhost");
Sts : AWS.SMTP.Status;
begin
AWS.SMTP.Client.Send
(SMTP_Server,
From => AWS.SMTP.E_Mail("Andrew", "andrew.shvets@gmail.com"),
To => AWS.SMTP.E_Mail("Andrew", "andrew.shvets@gmail.com"),
Subject => "Oh, who is it?",
Message => Sample_Mail,
Status => Sts);
if not AWS.SMTP.Is_Ok(Sts) then
Ada.Text_IO.Put_Line("ERROR: Can't send message: " & AWS.SMTP.Status_Message(Sts));
end if;
Ada.Text_IO.Put_Line("This is the reply code's message:");
Ada.Text_IO.Put_Line(" " & AWS.SMTP.Message(AWS.SMTP.Status_Code(Sts)));
end Text_Email;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment