Skip to content

weslleycapelari/SimpleMail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleMail


SimpleMail is a library to facilitate the sending of messages through SMTP connections.


⚙️ Installation

  • Manual installation: Add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path
../SimpleMail/src
  • Installation using the Boss:
boss install github.com/weslleycapelari/SimpleMail

🔰 Engines

By default, the library uses the most up-to-date components, in this case the current one is Indy.

⚡️ Quickstart

You need to use SimpleMail

uses SimpleMail;
  • Mail Server
var
  LMailer: IMail;
begin
  LMailer := TMail.New
    .Hostname('smtp.gmail.com')
    .Port(465)
    .Username('[email protected]')
    .Password('password')
    .SSL(True)
    .Timeout(10000)
    .Connect;

  if LMailer.IsConnected then
    ShowMessage('Connected')
  else
    ShowMessage('Not Connected');
end;
  • Message
var
  LMailer : IMail;
  LMessage: IMessage;
begin
  LMailer := TMail.New
    .Hostname('smtp.gmail.com')
    .Port(465)
    .Username('[email protected]')
    .Password('password')
    .SSL(True)
    .Timeout(10000)
    .Connect;

  if LMailer.IsConnected then
  begin
    LMessage := LMailer.NewMessage
      .From('[email protected]')
      .Recipients('[email protected];[email protected]')
      .CC('[email protected];[email protected]')
      .CCo('[email protected];[email protected]')
      .Subject('Test Email')
      .Body('This is a test message')
      .Send;

    LMailer.SendMessage(LMessage);
  end;
end;

📝 Samples

A project was developed inside the example folder

💻 Code Contributors

Code Contributors

⚠️ License

SimpleMail is free and open-source software licensed under the Apache-2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages